Arduino IDE Board support
#1
Just pulled my PADI IoT Stamps out of the cupboard, and thought I'd get them running again. I'd seen mention a while ago about them working with the Arduino IDE, so thought I'd see what the state of affairs was now. While it is possible to get them working, it could be better / easier for first time users.

Hence, based off the great work the Realtek Ameba Arduino team for getting support for the underlying MCU () working, and George Talusan (gtalusan) for a board support package for the Mac, I can now present a board support package that should work for Windows, Linux and Mac (take Mac support with a pinch of salt - George had tested it, but I don't have a Mac to test that side going forward).

However, it should be pretty easy going getting started now - assuming you have a SWD debugger such as the one pine64 stock.

It will be a simple (!) matter of adding both of the following URLs to the Addional Board URLs in the Arduino IDE preferences (the first is for the Ameba Arduino support package, and the second is for my board support package which tacks on the PADI build and upload support):

Code:
https://github.com/Ameba8195/Arduino/raw/master/release/package_realtek.com_ameba_index.json
https://raw.githubusercontent.com/pfeerick/PADIIoTStamp/master/release/package_padiiotstamp_index.json

Then go to the Boards manager, and first install the Realtek Ameba Arduino boards package, and then the PADI IoT Stamp boards package.

You'll also need to install OpenOCD. On Ubuntu linux, I used the version in the repositories. For Windows, I grabbed a compiled binary from http://gnutoolchains.com/arm-eabi/openocd/ - and unpacked it into C:\Program Files\OpenOCD - but take note, versions later than OpenOCD 0.10.0 [2017-08-21] do not seem to work.

Finally, if you are using the pine64 SWD debugger, you'll need to add an option to the interface/jlink.cfg file for openocd - transport select swd - otherwise you'll get lots of lovely error messages instead of an upload. 

There is more information on the GitHub page, and some troubleshooting hints on the wiki already... and more will be added over time... but that will do for now Wink
  Reply
#2
@pfreerick This post is almost 2 years old.  Can you comment on the current state of programming the padi with the arduino ide?  Has anything changed/improved from what you have written?

I've been using  esps for iot but would like to try the padi.  Before diving in I would like to know what programming effort to expect (vs an esp) circa 2019 specifically programming with arduinio ide or maybe even better using atom with platformio which is the ide I prefer to use.
  Reply
#3
Hello,

How do I install openocd earlier version ( on Mac OS X) ,say version 0.9.0 of openocd...?

-Thanks
-Alok
  Reply
#4
I downloaded 0.9.0 source code of openocd and compiled and installed on MAC OS X ,now I am getting this error in Arduino ide 

open On-Chip Debugger 0.9.0 (2019-05-20-08:44)
Licensed under GNU GPL v2
For bug reports, read
http://openocd.org/doc/doxygen/bugs.html
Info : auto-selecting first available session transport "jtag". To override use 'transport select <transport>'.
/Users/akmishra2/Library/Arduino15/packages/padiiotstamp/tools/openocd_tools/0.0.2/rtl8710.ocd:33: Error: invalid command name "dap"
in procedure 'script' 
at file "embeddedConfusedtartup.tcl", line 60
at file "/Users/akmishra2/Library/Arduino15/packages/padiiotstamp/tools/openocd_tools/0.0.2/rtl8710.ocd", line 33
the selected serial port at file "/Users/akmishra2/Library/Arduino15/packages/padiiotstamp/tools/openocd_tools/0.0.2/rtl8710.ocd", line 33
 does not exist or your board is not connected

thing which I noticed is by default jtag is selected and I am using Jlink/SWD from pine64.org,is there some settings I need to do...?

I used JLinkExe (from segger ) to connect to my PADI IoT Stamp, I can successfully connect and here is message which is displayed

Connecting to target via SWD
Found SW-DP with ID 0x2BA01477
Scanning AP map to find all available APs
AP[1]: Stopped AP scan as end of AP map has been reached
AP[0]: AHB-AP (IDR: 0x24770011)
Iterating through AP map to find AHB-AP to use
AP[0]: Core found
AP[0]: AHB-AP ROM base: 0xE00FF000
CPUID register: 0x412FC231. Implementer code: 0x41 (ARM)
Found Cortex-M3 r2p1, Little endian.
FPUnit: 6 code (BP) slots and 2 literal slots
CoreSight components:
ROMTbl[0] @ E00FF000
ROMTbl[0][0]: E000E000, CID: B105E00D, PID: 000BB000 SCS
ROMTbl[0][1]: E0001000, CID: B105E00D, PID: 003BB002 DWT
ROMTbl[0][2]: E0002000, CID: B105E00D, PID: 002BB003 FPB
ROMTbl[0][3]: E0000000, CID: B105E00D, PID: 003BB001 ITM
ROMTbl[0][4]: E0040000, CID: B105900D, PID: 003BB923 TPIU-Lite
ROMTbl[0][5]: E0041000, CID: B105900D, PID: 003BB924 ETM-M3
Cortex-M3 identified.

also I tried to use "J Flash Lite" from Segger ( to program flash on PADI IoT stamp) ,here is error message I get 


Conecting to J-Link...Connecting to target...
Downloading...
ERROR: Could not download file.
Done


What I need to do to get it worklng 

-Thanks
-Alok
  Reply
#5
Hello,

I added "transport select swd" in jlink.cfg file,but still I am not able to program,here is error message which I get ,why I am getting invalid command name dap...?

Open On-Chip Debugger 0.9.0 (2019-05-20-08:44)
Licensed under GNU GPL v2
For bug reports, read
http://openocd.org/doc/doxygen/bugs.html
Info : JLink SWD mode enabled
swd
/Users/akmishra2/Library/Arduino15/packages/padiiotstamp/tools/openocd_tools/0.0.2/rtl8710.ocd:33: Error: invalid command name "dap"
in procedure 'script'
at file "embeddedConfusedtartup.tcl", line 60
at file "/Users/akmishra2/Library/Arduino15/packages/padiiotstamp/tools/openocd_tools/0.0.2/rtl8710.ocd", line 33
the selected serial port at file "/Users/akmishra2/Library/Arduino15/packages/padiiotstamp/tools/openocd_tools/0.0.2/rtl8710.ocd", line 33
does not exist or your board is not connected

-Thanks
-Alok
  Reply


Possibly Related Threads...
Thread Author Replies Views Last Post
  Programming IOT Stamp with Arduino IDE aunrau 5 1,064 10-23-2017, 03:40 PM
Last Post: dkryder
  Arduino board package for PADI IoT Stamp lapse 6 3,184 06-09-2017, 06:07 AM
Last Post: thomash

Forum Jump:


Users browsing this thread: 1 Guest(s)