Debian Jessie LXDE (ROCK64) 20170809 [Aug 16] | Armbian - Xenial (SOPINE) 5.30 [Aug 16] | Armbian (PINE A64(+)) 5.30 [Aug 16] | openHAB 2 (PINE A64(+)) v1.3 [Aug 16] | motionEyeOS (PINE A64(+)) 20170710 [Aug 16] | Volumio (PINE A64(+)) 2.166 [Aug 16] | FalconGate (PINE A64(+)) 20170705 [Aug 16] | Android Images (ROCK64) 20170804 [Aug 8] | Linux Images (ROCK64) 0.4.16-83 [Aug 4]

Getting Started | Visit the WIKI | IRC Logs | Forum Rules/Policy


Arduino board package for PADI IoT Stamp
#1
Howdy,

I bodged together a board package for the PADI IoT Stamp in the Arduino IDE.  I don't have the official SWD debugger, so I used an eBay ST-Link V2 and OpenOCD.  It runs great under OS X and shouldn't be hard to run under Linux.  Windows, maybe more work is involved.

I can blink an LED and scan for networks quite well.  Haven't had much time for anything else.

Here's the URL:

https://github.com/gtalusan/PADIIoTStamp

Enjoy!
Reply
#2
Nice work! I'll give that a spin later on and hopefully leave you some positive feedback. Wink  Having an easily installable Arduino IDE package for the PADI will certainly make it a lot more accessible and attractive to the wider DIY community.
Reply
#3
(02-26-2017, 10:08 PM)lapse Wrote: Howdy,

I bodged together a board package for the PADI IoT Stamp in the Arduino IDE.  I don't have the official SWD debugger, so I used an eBay ST-Link V2 and OpenOCD.  It runs great under OS X and shouldn't be hard to run under Linux.  Windows, maybe more work is involved.

I can blink an LED and scan for networks quite well.  Haven't had much time for anything else.

Here's the URL:

https://github.com/gtalusan/PADIIoTStamp

Enjoy!
Thank you for offering some examples .  This chip is not getting a lot from traction from vocal users.

Following your repo, I had to make a few changes to run under linux ( just like you expected)

1- changed "~/.arduino15/packages/padiiotstamp/hardware/ameba/0.0.4/platform.txt" to use the stock openocd on debian
  /usr/bin/openocd gets 0.8.0 on debian jessie
  /usr/local/bin/openocd is appropriate if you rolled your own ( more recent) copy of openocd

2- changed "package_padiiotstamp_index.json" in a local clone of your repo to update the 
    a- toolsDependancies for ameba_tools to 1.0.9  - because of ameba's change for linux recently
    b- added new hosts to tools stanza for i686-linux-gnu,  x86_64-linux-gnu, i686-pc-linux-gnu, x86_64-pc-linux-gnu
         these used the same archives, url, etc because that are not system dependent.


I need some advice :
 after these changes I still cannot write the chip.  I am using the padi swd debugger and I'm probably missing something.

I ended  up removing the logic test for using_hla in rtl8710.ocd because it was undefined. Best I can tell, it is defined by the target startup
code src/target/startup.tcl, but I don't think that is called except from a target command

the swd debugger is found, but no serial port is created, nor any mbed block device.

Code:
[6898183.721649] usb 1-1.3: new full-speed USB device number 6 using dwc_otg
[6898183.826836] usb 1-1.3: New USB device found, idVendor=1366, idProduct=0101
[6898183.826859] usb 1-1.3: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[6898183.826872] usb 1-1.3: Product: J-Link
[6898183.826885] usb 1-1.3: Manufacturer: SEGGER
[6898183.826897] usb 1-1.3: SerialNumber: 000000123456

openocd process is defaulting to jtag transport, and I don't know where to invoke a change to swd.....

Code:
snipped from arduino logging:
--snip--
Sketch uses 271732 bytes (10%) of program storage space. Maximum is 2499639 bytes.
/usr/bin/openocd -f interface/jlink.cfg -f /home/brado/.arduino15/packages/padiiotstamp/tools/openocd_10_flash_auto_erase 1 -c rtl8710_flash_auto_verify 1 -c rtl8710_flash_write /home/brado/.arduino15/pac reset -c shutdown
Open On-Chip Debugger 0.8.0 (2014-10-20-21:48)
Licensed under GNU GPL v2
For bug reports, read
        http://openocd.sourceforge.net/doc/doxygen/bugs.html
Info : only one transport option; autoselect 'jtag'
adapter speed: 500 kHz
adapter_nsrst_delay: 100
cortex_m reset_config sysresetreq
rtl8710_reboot
Info : J-Link initialization started / target CPU reset initiated
Info : J-Link ARM-OB STM32 compiled Aug 22 2012 19:52:04
Info : J-Link caps 0x88ea5833
Info : J-Link hw version 70000
Info : J-Link hw type J-Link
Info : J-Link max mem block 11288
Info : J-Link configuration
Info : USB-Address: 0x0
Info : Kickstart power on JTAG-pin 19: 0x0
Info : Vref = 3.300 TCK = 1 TDI = 1 TDO = 1 TMS = 1 SRST = 0 TRST = 1
Info : J-Link JTAG Interface ready
Info : clock speed 500 kHz
Error: JTAG scan chain interrogation failed: all ones
Error: Check JTAG interface, timings, target power, etc.
Error: Trying to use configured scan chain anyway...
Error: rtl8710.cpu: IR capture error; saw 0x0f not 0x01
Warn : Bypassing JTAG setup events due to errors
Warn : Invalid ACK 0x7 in JTAG-DP transaction
Error: JTAG scan chain interrogation failed: all ones
Error: Check JTAG interface, timings, target power, etc.
Error: Trying to use configured scan chain anyway...
Error: rtl8710.cpu: IR capture error; saw 0x0f not 0x01
Warn : Bypassing JTAG setup events due to errors
Warn : Invalid ACK 0x7 in JTAG-DP transaction
Error: Target not examined yet


in procedure 'reset'
the selected serial port in procedure 'reset'
 does not exist or your board is not connected
--snip--

$ /usr/bin/openocd -v
Open On-Chip Debugger 0.8.0 (2014-10-20-21:48)

If anybody has found docs on the pine swd debugger, or has some working examples, let me know.

Thanks again to "lapse" for his work.
Reply
#4
#1 It should be in openocd's directory interface/jlink.cfg
simply grep jtag * and see...

then replace by swd - something like transport swd

#2 take a look at https://github.com/pvvx/RtlDuino
it has worked for me
Reply
#5
Thank you for the suggestions.
I did not have any problem with jtag hardware itself.  I suspect it is because I used SEGGER software once, and it auto upgraded the firmware, bricking it. Now any attempts to use end up with scan chain failures.  It  denies any attempt to leave jtag for swd.

I have a workaround using a raspberry pi as swd interface that will hold me over while I look for a way to downgrade/replace the SEGGER firmware.

I'll take a look at rtlduino next
Reply
#6
Raspberry pi + openocd worked well for me.
Reply
#7
Got OSX and Windows working, needed the 0.9.0 version of OpenOCD http://gnuarmeclipse.github.io/blog/2015...-released/ to fix a problem with the jim-ctl interpreter.

Also had to add "transport select swd" to interface/jlink.cfg and on Windows I had to install the libusb driver and hardcoded the path to the binary in the platform.txt file.
Reply


Possibly Related Threads...
Thread Author Replies Views Last Post
  VGA Driver for PADI IoT Stamp kissste 1 692 12-15-2016, 10:46 AM
Last Post: tllim

Forum Jump:


Users browsing this thread: 1 Guest(s)