These are chat archives for marvell-iot/aws_starter_sdk

5th
Jan 2016
Scotty Nelson
@poorboy44
Jan 05 2016 03:25
Hi @anujdeshpande. It's Scotty with the Marvell / Mac driver issue. Can you suggest anything else?
Anuj Deshpande
@anujdeshpande
Jan 05 2016 03:26

hey @poorboy44 Can you try the load command again ? Don't unload, util and then load

when you reboot, and you get the Failed to load error, use the load command without using the unload and util.

Scotty Nelson
@poorboy44
Jan 05 2016 03:28
@anujdeshpande just to clarify, reboot my Mac?
Anuj Deshpande
@anujdeshpande
Jan 05 2016 03:28
Yes
Scotty Nelson
@poorboy44
Jan 05 2016 03:28
ok will do
Anuj Deshpande
@anujdeshpande
Jan 05 2016 03:28
thanks
Scotty Nelson
@poorboy44
Jan 05 2016 03:34

@anujdeshpande I rebooted, plugged in the device then did the following : ```[snelson aws_starter_sdk (master)]$ sudo wmsdk/tools/OpenOCD/flash.py --mcufw bin/mw302_rd/hello_world.bin
Password:
Writing MCU firmware to flash
Using OpenOCD interface file ftdi.cfg
Open On-Chip Debugger 0.9.0 (2015-12-16-16:48)
Licensed under GNU GPL v2
For bug reports, read
http://openocd.org/doc/doxygen/bugs.html
flash
adapter speed: 3000 kHz
adapter_nsrst_delay: 100
Info : auto-selecting first available session transport "jtag". To override use 'transport select <transport>'.
jtag_ntrst_delay: 100
cortex_m reset_config sysresetreq
sh_load
Error: libusb_claim_interface() failed with LIBUSB_ERROR_ACCESS
Error: unable to open ftdi device with vid 0403, pid 6010, description 'Dual RS232' and serial '*'

Writing MCU firmware to flash failed...
[snelson aws_starter_sdk (master)]$ sudo kextload -b com.apple.driver.AppleUSBFTDI
[snelson aws_starter_sdk (master)]$ sudo wmsdk/tools/OpenOCD/flash.py --mcufw bin/mw302_rd/hello_world.bin
Writing MCU firmware to flash
Using OpenOCD interface file ftdi.cfg
Open On-Chip Debugger 0.9.0 (2015-12-16-16:48)
Licensed under GNU GPL v2
For bug reports, read
http://openocd.org/doc/doxygen/bugs.html
flash
adapter speed: 3000 kHz
adapter_nsrst_delay: 100
Info : auto-selecting first available session transport "jtag". To override use 'transport select <transport>'.
jtag_ntrst_delay: 100
cortex_m reset_config sysresetreq
sh_load
Error: libusb_claim_interface() failed with LIBUSB_ERROR_ACCESS
Error: unable to open ftdi device with vid 0403, pid 6010, description 'Dual RS232' and serial '*'

Writing MCU firmware to flash failed...
```

Anuj Deshpande
@anujdeshpande
Jan 05 2016 03:36
Can you paste the output of sudo dmesg ?
Scotty Nelson
@poorboy44
Jan 05 2016 03:37

[snelson aws_starter_sdk (master)]$ sudo dmesg
ile-write-unlink /private/var/run/dyld_shared_cache_x86_64h
Sandbox: launchd(1) System Policy: deny(1) file-write-flags /private/var/run/dyld_shared_cache_x86_64h.map
Sandbox: launchd(1) System Policy: deny(1) file-write-unlink /private/var/run/dyld_shared_cache_x86_64h.map
Sandbox: launchd(1) System Policy: deny(1) file-write-flags /private/var/run/dyld_shared_cache_x86_64h
Sandbox: launchd(1) System Policy: deny(1) file-write-unlink /private/var/run/dyld_shared_cache_x86_64h
Sandbox: launchd(1) System Policy: deny(1) file-write-flags /private/var/run/dyld_shared_cache_x86_64h.map
Sandbox: launchd(1) System Policy: deny(1) file-write-unlink /private/var/run/dyld_shared_cache_x86_64h.map
Sandbox: launchd(1) System Policy: deny(1) file-write-flags /private/var/run/dyld_shared_cache_x86_64h
Sandbox: launchd(1) System Policy: deny(1) file-write-unlink /private/var/run/dyld_shared_cache_x86_64h
Sandbox: launchd(1) System Policy: deny(1) file-write-flags /private/var/run/dyld_shared_cache_x86_64h.map
Sandbox: launchd(1) System Policy: deny(1) file-write-unlink /private/var/run/dyld_shared_cache_x86_64h.map
Sandbox: launchd(1) System Policy: deny(1) file-write-flags /private/var/run/dyld_shared_cache_x86_64h
Sandbox: launchd(1) System Policy: deny(1) file-write-unlink /private/var/run/dyld_shared_cache_x86_64h
Sandbox: launchd(1) System Policy: deny(1) file-write-flags /private/var/run/dyld_shared_cache_x86_64h.map
Sandbox: launchd(1) System Policy: deny(1) file-write-unlink /private/var/run/dyld_shared_cache_x86_64h.map
IOBluetoothUSBDFU::probe
IOBluetoothUSBDFU::probe ProductID - 0x8289 FirmwareVersion - 0x0112
IO80211Controller::dataLinkLayerAttachComplete(): adding AppleEFINVRAM notification
IO80211Interface::efiNVRAMPublished():
initting Scan Manager controller 0xd6e1dd0e694663c1 ioservice 0xd6e1dd0cea2483c1 interface 0xd6e1dd0cea4c07c1 ioservce 0xd6e1dd0e694663c1
bpfAttach len 64 dlt 12
fInterfaceSnapshots is missing
fInterfaceSnapshots is missing
fInterfaceSnapshots is missing
fInterfaceSnapshots is missing
fInterfaceSnapshots is missing
fInterfaceSnapshots is missing
fInterfaceSnapshots is missing
fInterfaceSnapshots is missing
fInterfaceSnapshots is missing
fInterfaceSnapshots is missing
Waiting for DSMOS...
IOGraphics flags 0x43
AppleCamIn::init
AppleCamIn::probe
AppleCamIn::start
virtual bool AppleCamIn::start(IOService ): about to configure DDR
AppleCamIn::start - S2 DDR Frequency set to 450 MHz (default)
[IOBluetoothHostControllerUSBTransport][start] -- completed -- result = TRUE -- 0x3000
[BroadcomBluetoothHostControllerUSBTransport][start] -- Completed (matched on Device) -- 0x3000
[IOBluetoothFamily][staticBluetoothTransportShowsUp] -- Received Bluetooth Controller register service notification -- 0x3000
[IOBluetoothFamily][start] -- completed
[IOBluetoothHostController][start] -- completed
[IOBluetoothHostController::setConfigState] calling registerService
* [IOBluetoothFamily][ProcessBluetoothTransportShowsUpActionWL] -- calling IOBluetoothFamily's registerService() -- 0x5df0 -- 0xb600 -- 0x3000

[IOBluetoothFamily][ProcessBluetoothTransportShowsUpActionWL] -- Connected to the transport successfully -- 0x5df0 -- 0xb600 -- 0x3000

Previous shutdown cause: 5
DSMOS has arrived
IOPPF - IODeviceTree:/efi/platform/StartupPowerEvents: 0x0
hmm.. mismatch sizes: 3100 vs 20
PPGTT is enabled
save_ddr_phy_regs: saving 127 DDR PHY shmoo-calibrated registers
AppleCamIn::start - link control offset in PCI bridge = 0x50
AppleCamIn::start - pmcsr offset in PCI bridge = 0xa4
AppleCamIn::power_off_hardware
AppleCamIn::initForPM
AppleCamIn::systemWakeCall - messageType = 0xE0000340
AirPort: Link Down on en0. Reason 8 (Disassociated because station leaving).
Got incomplete channel sequence length 0, should be 16
Got incomplete channel sequence length 0, should be 16
en0: channel changed to 1
en0::IO80211Interface::postMessage bssid changed
bpfAttach len 94 dlt 163
bpfAttach len 30 dlt 105
bpfAttach len 52 dlt 127
bpfAttach len 38 dlt 192
I

oops that got truncated. here's the reelvant bit
Sandbox: AssetCacheLocato(683) deny(1) mach-lookup com.apple.cookied
Sandbox: systemsoundserve(311) deny(1) file-read-metadata /private/var/root
Google Chrome He[1006] triggered unnest of range 0x7fff8ae00000->0x7fff8b000000 of DYLD shared region in VM map 0x62c8fffb36b0d6eb. While not abnormal for debuggers, this increases system memory footprint until the target exits.
FTDIUSBSerialDriver: 0 4036010 start - ok
FTDIUSBSerialDriver: 0 4036010 start - ok
Google Chrome He[1060] triggered unnest of range 0x7fff8ae00000->0x7fff8b000000 of DYLD shared region in VM map 0x62c8fffb28038863. While not abnormal for debuggers, this increases system memory footprint until the target exits.
Google Chrome He[1061] triggered unnest of range 0x7fff8ae00000->0x7fff8b000000 of DYLD shared region in VM map 0x62c8fffb2c3dc76b. While not abnormal for debuggers, this increases system memory footprint until the target exits.
Anuj Deshpande
@anujdeshpande
Jan 05 2016 03:41
The output should be something like
AppleUSBFTDI: fInBufPool,kMaxInBufPool 8,64
         0 [Level 5] [com.apple.message.domain com.apple.commssw.ftdi.device] [com.apple.message.signature AppleUSBFTDI] [com.apple.message.signature2 0x403] [com.apple.message.signature3 0x6010] [com.apple.message.summarize YES]
AppleUSBFTDI: Version number - 5.0.0, Input buffers 8, Output buffers 16
Give me a minute, rebooting
Scotty Nelson
@poorboy44
Jan 05 2016 03:45
ok
Anuj Deshpande
@anujdeshpande
Jan 05 2016 03:48

Nope, no luck

can you give the outputs of
uname -a

I already have this

[snelson ~]$ libusb-config --version
0.1.12

I'll try to find a machine matching your config

Scotty Nelson
@poorboy44
Jan 05 2016 03:48
[snelson aws_starter_sdk (master)]$ uname -a
Darwin snelson.local 15.2.0 Darwin Kernel Version 15.2.0: Fri Nov 13 19:56:56 PST 2015; root:xnu-3248.20.55~2/RELEASE_X86_64 x86_64
Anuj Deshpande
@anujdeshpande
Jan 05 2016 03:53
➜  ~  libusb-config --version
0.1.12
➜  ~  uname -a
Darwin Anujs-MacBook-Pro.local 15.2.0 Darwin Kernel Version 15.2.0: Fri Nov 13 19:56:56 PST 2015; root:xnu-3248.20.55~2/RELEASE_X86_64 x86_64
➜  ~  kextstat|grep FTDI
  144    0 0xffffff7f82e03000 0x7000     0x7000     com.apple.driver.AppleUSBFTDI (5.0.0) 4C5CCB24-156D-31A0-9865-FECAC4AB403E <115 38 5 4 3 1>
➜  ~
strange, my config matches yours.
do you have access to another machine that you can use to verify if this persists ?
Scotty Nelson
@poorboy44
Jan 05 2016 03:56
hmm let me try my wife's macbook air. hang on
Anuj Deshpande
@anujdeshpande
Jan 05 2016 03:56
sure, thanks
Scotty Nelson
@poorboy44
Jan 05 2016 04:01
she's running OSX 10.8.5. when I plug it in, it doesn't show up in ls -l /dev/tty* at all...
Anuj Deshpande
@anujdeshpande
Jan 05 2016 04:01
does the machine have libusb installed ?
Scotty Nelson
@poorboy44
Jan 05 2016 04:02
no...
do u want me to set that up?
she doesn't have any dev tools on her machine
Anuj Deshpande
@anujdeshpande
Jan 05 2016 04:03
That would be great
Scotty Nelson
@poorboy44
Jan 05 2016 04:03
ok
Scotty Nelson
@poorboy44
Jan 05 2016 04:11
hmm does it matter that openocd is version 0.7 instead of 0.9? homebrew doesn't have 0.9 right now
Anuj Deshpande
@anujdeshpande
Jan 05 2016 04:12
Will have to be 0.9
Btw openocd from home-brew is 0.9
➜  ~  brew list openocd
/usr/local/Cellar/open-ocd/0.9.0/bin/openocd
/usr/local/Cellar/open-ocd/0.9.0/share/info/ (3 files)
/usr/local/Cellar/open-ocd/0.9.0/share/man/man1/openocd.1
/usr/local/Cellar/open-ocd/0.9.0/share/openocd/ (587 files)
➜
➜  ~  brew install openocd
Warning: open-ocd-0.9.0 already installed
Scotty Nelson
@poorboy44
Jan 05 2016 04:13
ah maybe i need to update brew
can you give me a high level description on what you think might be happening ?
are we not overriding the Apple Driver properly?
this is my very first embedded project so i am not familiar with any of this stuff
Anuj Deshpande
@anujdeshpande
Jan 05 2016 04:19
Sure
So OpenOCD uses FTDI drivers to communicate over USB to the FTDI chip onboard the development board that you have
The FTDI chip then communicates with the JTAG pins on the micro controller debug
The FTDI chip creates 2 serial ports, one for the JTAG interface and one for serial
the serial is the one that we need to enable the console (which is where we will see printf outputs from our application code)
OpenOCD depends on libusb to be able to communicate with chips like the onboard FTDI chip
Plus, openocd is one of those softwares which has very few releases. So anything before 0.9 is guaranteed not to work
Scotty Nelson
@poorboy44
Jan 05 2016 04:27
so, what is the kextload command doing exactly?
sudo kextload -b com.apple.driver.AppleUSBFTDI
is it associating AppleUSBFTDI driver with the serial connection?
ok. i got libusb & openocd 0.9 installed on my wife's machine. rebooting...
Anuj Deshpande
@anujdeshpande
Jan 05 2016 04:29
drivers are extensions to the kernels so to speak
the OS has a file which associates USB vid and pid with the driver to be loaded
so when we connect a device, it should look up the vid and pid and automatically load the driver
But that isn't working for some strange reason
what we are doing is manually doing what the OS is supposed to do

Alright, make sure you see the output of lsusb, ls /dev/tty.* before and after connecting

Run the kextutil and kextunload commands after that and try flash.py -r after that.

that should reset the board/
Scotty Nelson
@poorboy44
Jan 05 2016 04:33
on the macbook air, it says it can't find extension with identifier com.apple.AppleUSBFTDI
(when I try to unload)
Anuj Deshpande
@anujdeshpande
Jan 05 2016 04:35
and the ls /dev/tty.* output ?
Scotty Nelson
@poorboy44
Jan 05 2016 04:37
its not showing up, nothing with usb in there
Scotty Nelson
@poorboy44
Jan 05 2016 04:54
is this helpful? i'm noticing one of these kext files is in /Library/Extensions, the other is in /System/Library/Extensions
snelson aws_starter_sdk (master)]$ sudo find / -name "*.kext" | grep FTDI
find: /dev/fd/3: Not a directory
find: /dev/fd/4: Not a directory
/Library/Extensions/FTDIUSBSerialDriver.kext
/System/Library/Extensions/AppleUSBFTDI.kext
Anuj Deshpande
@anujdeshpande
Jan 05 2016 04:55
what's uname -a on the other machine ?
Scotty Nelson
@poorboy44
Jan 05 2016 04:58
localhost:aws_starter_sdk samiam$ uname -a
Darwin localhost 12.6.0 Darwin Kernel Version 12.6.0: Wed Mar 18 16:23:48 PDT 2015; root:xnu-2050.48.19~1/RELEASE_X86_64 x86_64
Scotty Nelson
@poorboy44
Jan 05 2016 05:13
This is what's inside /System/Library/Extensions/AppleUSBFTDI.kext/Contents/Info.plist:
        <key>AppleUSBEFTDI-6010-1</key>
        <dict>
            <key>CFBundleIdentifier</key>
            <string>com.apple.driver.AppleUSBFTDI</string>
            <key>IOClass</key>
            <string>AppleUSBFTDI</string>
            <key>IOProviderClass</key>
            <string>IOUSBHostInterface</string>
            <key>InputBuffers</key>
            <integer>8</integer>
            <key>OutputBuffers</key>
            <integer>16</integer>
            <key>bConfigurationValue</key>
            <integer>1</integer>
            <key>bInterfaceNumber</key>
            <integer>1</integer>
            <key>idProduct</key>
            <integer>24592</integer>
            <key>idVendor</key>
            <integer>1027</integer>
        </dict>
do those values ^^ look right?
Scotty Nelson
@poorboy44
Jan 05 2016 05:26
alright i got it to flash from my wife's Macbook Air. ls /dev/tty.* doesnt even show the device so i;m quite confused...
localhost:aws_starter_sdk samiam$ sudo wmsdk/tools/OpenOCD/flash.py --mcufw /Users/samiam/aws_starter_sdk/bin/mw302_rd/hello_world.bin
Writing MCU firmware to flash...
Using OpenOCD interface file ftdi.cfg
Open On-Chip Debugger 0.9.0 (2016-01-04-21:26)
Licensed under GNU GPL v2
For bug reports, read
    http://openocd.org/doc/doxygen/bugs.html
flash
adapter speed: 3000 kHz
adapter_nsrst_delay: 100
Info : auto-selecting first available session transport "jtag". To override use 'transport select <transport>'.
jtag_ntrst_delay: 100
cortex_m reset_config sysresetreq
sh_load
Info : clock speed 3000 kHz
Info : JTAG tap: wmcore.cpu tap/device found: 0x4ba00477 (mfg: 0x23b, part: 0xba00, ver: 0x4)
Info : wmcore.cpu: hardware has 6 breakpoints, 4 watchpoints
Info : JTAG tap: wmcore.cpu tap/device found: 0x4ba00477 (mfg: 0x23b, part: 0xba00, ver: 0x4)
target state: halted
target halted due to debug-request, current mode: Thread 
xPSR: 0x01000000 pc: 0x00007f14 msp: 0x20001000
auto erase enabled
Info : Found flash device 'win w25q32fv' ID 0x001640ef
wrote 65536 bytes from file /Users/samiam/aws_starter_sdk/bin/mw302_rd/hello_world.bin in 0.839480s (76.238 KiB/s)
shutdown command invoked
Writing MCU firmware to flash done...
localhost:aws_starter_sdk samiam$  ls -l  /dev/tty.usbserial*
ls: /dev/tty.usbserial*: No such file or directory
i have to go to sleep... can you advise me on how I can get this working on my MacBook Pro?
Anuj Deshpande
@anujdeshpande
Jan 05 2016 05:52
@poorboy44 I am trying to recreate the issue on some of my co-workers machines. this might take a while. I'll keep you posted here
Amey Inamdar
@ameyinamdar
Jan 05 2016 05:54
@poorboy44 please make sure that there is no other FTDI driver loaded:
pe-lt1027:mw300 amey$ kextstat | grep FTDI
  332    0 0xffffff7f82e05000 0x7000     0x7000     com.apple.driver.AppleUSBFTDI (5.0.0) 03040534-89B3-3361-90F2-65DF174C1AAC <99 38 5 4 3 1>
I see you have installed FTDIUSBSerialDriver too. Please make sure that that is not causing a conflict. To be on the safer side, you can mv /Library/Extensions/FTDIUSBSerialDriver.kext file at some other location.