ARM-USB-TINY-H and IAR EW [quite SOLVED !!!]

Started by micro, January 29, 2018, 10:02:13 PM

Previous topic - Next topic

micro

Hi guys,

I have LPC-2378-STK, ARM-USB-TINY-H, and windows 7 ultimate 64bit
and I should work with IAR EW using OpenOCD and ARM-USB-TINY-H.
I'm a little confused about software and drivers versions to use together IAR EW (which version?) and ARM-USB-TINY-H.

I have the following questions:

1) Which IAR EW version should I use ?
2) Which OpenOCD version should I use ?
3) Which driver type/version for ARM-USB-TINY-H ?


thanks for support!



LubOlimex

1) Which IAR EW version should I use ?

If you wish to compile without problems the demo provided by Olimex for LPC-2378-STK, you need to use the same version as the one used to make the demo - this means version 6.30; but probably other 6.x versions would work too.

If you use another general LPC2378 demo or write your own demo you can use any IAR version, including the latest.

This is also a good document on how to setup IAR, OpenOCD and OpenOCD-compatible tool: https://www.olimex.com/Products/ARM/JTAG/_resources/Manual_IAR.pdf

2) Which OpenOCD version should I use ?

The latest official release 0.10.0 is alright. Freddie Chopin provides pre-compiled packages for Windows: http://www.freddiechopin.info/en/download/category/4-openocd

3) Which driver type/version for ARM-USB-TINY-H ?

For Windows 10 and latest OpenOCD use Zadig installer as detailed in chapter "3.3.3 Driver installation in Windows", pages 14/15 in the user's manual.

Best regards,
Lub/OLIMEX
Technical support and documentation manager at Olimex

micro

Thanks for your answers!
I am very grateful for your support.

just another question before my software installation.

OpenOCD 0.10.0 is compatible with IAR 6.3 GDB server debug? is it tested?

LubOlimex

I can't remember if I tested it. It should be alright, I don't see why it wouldn't work. If there are problems you can always use the 0.9.0 version that I have tested for sure (it also works with Zadig installer method): https://www.olimex.com/Products/ARM/JTAG/_resources/OpenOCD-OLIMEX-WINDOWS.zip
Technical support and documentation manager at Olimex

micro

I have installed software and Flashing operation doesn't work.
I tried GettingStarting by olimex lpc2378-stk examples with GDB debugger configuration:"
"Make" working fine without error/warning but I got FATAL ERROR using Flash debug version and pushing "download and debug":

Wed Jan 31, 2018 07:19:27: Loaded macro file: C:\Program Files (x86)\IAR Systems\Embedded Workbench 6.0\arm\config\flashloader\NXP\LPC23xx24xx.mac
Wed Jan 31, 2018 07:19:27: 2048 bytes downloaded and verified (5.57 Kbytes/sec)
Wed Jan 31, 2018 07:19:27: Warning: 
Verify error at address 0x40000000, target byte: 0x5F, byte in file: 0x34
...(and many similar errors)
...
Wed Jan 31, 2018 07:19:34: Fatal error: There were warnings during download of FLASH loader, see Log Window   Session aborted!
Wed Jan 31, 2018 07:19:34: Failed to load flash loader: C:\Program Files (x86)\IAR Systems\Embedded Workbench 6.0\arm\config\flashloader\NXP\FlashLayout3RAM32K.out
Wed Jan 31, 2018 07:19:34: Failed to load flash loader: C:\Program Files (x86)\IAR Systems\Embedded Workbench 6.0\arm\config\flashloader\NXP\FlashNXPLPC512K2.flash



this is my configuration:

Windows 7 ultimate 64bit
OpenOCD 0.9.0 rc1 + winusb Zadig (https://www.olimex.com/Products/ARM/JTAG/_resources/OpenOCD-OLIMEX-WINDOWS.zip)
IAR EW ARM 6.3

OpenOCD and JTAG seems working fine: lpc2378 is detected and has 2 breakpoints...

LubOlimex

The demo seems to build fine here. It seems like the linker at your side uses built-in processor description file (icf). Can you check if the linker uses the icf that is located in the project folders. Refer to this image:

Technical support and documentation manager at Olimex

micro

#6
GettingStarted builds fine as well.

Flashing operation dosn't work!

When I push "download and debug" I get FATAL ERROR and many errors in log:
Wed Jan 31, 2018 17:42:41: Loaded macro file: C:\Program Files (x86)\IAR Systems\Embedded Workbench 6.0\arm\config\flashloader\NXP\LPC23xx24xx.mac
Wed Jan 31, 2018 17:42:42: 2048 bytes downloaded and verified (5.57 Kbytes/sec)
Wed Jan 31, 2018 17:42:42: Warning: 
Verify error at address 0x40000000, target byte: 0x57, byte in file: 0x34
Wed Jan 31, 2018 17:42:42: Warning: 
Verify error at address 0x40000001, target byte: 0x71, byte in file: 0x07
...
...
Wed Jan 31, 2018 17:42:53: Fatal error: There were warnings during download of FLASH loader, see Log Window   Session aborted!
Wed Jan 31, 2018 17:42:53: Failed to load flash loader: C:\Program Files (x86)\IAR Systems\Embedded Workbench 6.0\arm\config\flashloader\NXP\FlashLayout3RAM32K.out
Wed Jan 31, 2018 17:42:53: Failed to load flash loader: C:\Program Files (x86)\IAR Systems\Embedded Workbench 6.0\arm\config\flashloader\NXP\FlashNXPLPC512K2.flash

Sometimes I get:




Other times I get:






micro


LubOlimex

#8
The problem seems to be in the configuration file of the lpc2378 (lpc2378.cfg). It seems the flash memory area is not defined properly and OpenOCD attempts to write in an address that is unavailable (probably the same space is used by the bootloader).

Can you test with the RAM debug configuration instead of the flash debug configuration (over the project tree in IAR from the drop down menu select "RAM debug" instead of "Flash debug")?

Edit: Quite likely the problem is somewhere in the OpenOCD scripts; quite unlikely the problem is the IAR GDB sequence (very low probability since the same behavior remains using different IAR versions); the project seems to be alright it uploads fine via other tools.
Technical support and documentation manager at Olimex

LubOlimex

#9
It seems to work better using this older version of OpenOCD: ftp://staging.olimex.com/Lub-clients/openocd-0.6.1.zip

openocd-x64-0.6.1.exe -f interface/ftdi/olimex-arm-usb-tiny-h.cfg -f /target/lpc2378.cfg

Technical support and documentation manager at Olimex

micro

thanks for support!
you make me feel a satisfied and happy customer!

Quote from: LubOlimex on February 02, 2018, 10:40:37 AM
The problem seems to be in the configuration file of the lpc2378 (lpc2378.cfg). It seems the flash memory area is not defined properly and OpenOCD attempts to write in an address that is unavailable (probably the same space is used by the bootloader).

Can you test with the RAM debug configuration instead of the flash debug configuration (over the project tree in IAR from the drop down menu select "RAM debug" instead of "Flash debug")?

Edit: Quite likely the problem is somewhere in the OpenOCD scripts; quite unlikely the problem is the IAR GDB sequence (very low probability since the same behavior remains using different IAR versions); the project seems to be alright it uploads fine via other tools.
I've already tested the RAM debug configuration and It works fine!  ;)


Quote from: LubOlimex on February 02, 2018, 01:27:32 PM
It seems to work better using this older version of OpenOCD: ftp://staging.olimex.com/Lub-clients/openocd-0.6.1.zip

openocd-x64-0.6.1.exe -f interface/ftdi/olimex-arm-usb-ocd-h.cfg -f /target/lpc2378.cfg
Ok!
I will try that version... but which jtag drivers I have to use?
The same driver that I've already installed (winusb driver with zadig) ?

LubOlimex

Yeah, the drivers seems to work fine.

It still reports some warnings but it seems to be able to program the target and debugging seems to work.
Technical support and documentation manager at Olimex

micro

#12
Ok!  :)
I've modified delay time in 100ms in LPC23xx24xx.mac and now I have no errors in debug log,
but only flash programming freezed as described above: flash loader is loaded.

Than I've tried 0.6.1 version and now Flash Debug version works better, rom is flashed and writed!!!!  ;) ;) ;)
(For other guys: without 100ms delay in LPC23xx24xx.mac dosn't work! take care!)
But flash loader works fine only the first time I push "download and debug",
following times doesn't work, same errors as the 0.9.0 openocd version, so I have to quit and reopen openocd and IAR.

Any suggestions ?


PS: rom is writed fine but openOCD shows same errors, so I think that errors are "non real" errors. you know?