I receive the error message below when trying to debug the RDK-S2E application.
I am using CC 5.1.1 and the BlackHawk USB-100v2-ARM emulator.
I have not modified the application that came with the SDK. I am still trying do basic stuff.
BlackHawk indicates that the problem is on TI end as their "test connection" diags pass.
CORTEX_M3_0: GEL Output:
Memory Map Initialization Complete
CORTEX_M3_0: GEL Output: Watchdog Timer Enabled
CORTEX_M3_0: GEL Output: UARTs Enabled
CORTEX_M3_0: Can't Run Target CPU: (Error -1268 @ 0x1090001) Device is locked up in Hard Fault or in NMI. Reset the device, and retry the operation. If error persists, confirm configuration, power-cycle the board, and/or try more reliable JTAG settings (e.g. lower TCLK). (Emulation package 5.0.569.0)
Hello John,
I have programmed both CCS projects included in the RDK-S2E with the Blackhawk USB-100v2-ARM Rev 3.1.
These are the steps I followed to succesfully program the Serial to Ethernet Kit:
1) Import the boot_eth CCS project from C:/Stellarisware/boards/rdk-s2e/boot_eth
2) Make sure the target configuration in CCS is the following:
3) Provided USB power to the Blackhawk XDS100v2 Emulator and to the RDK-S2E.
4) Download the application. (Click on debug)
Note: Make sure you have the latest XDS100v2 drivers. To check if there are avaiable BlackHawk drivers click on Help->Check for Updates and the available updates will appear.
There are a few questions I would like you for you to provide more information on.
1) When you connect an Ethernet cable and provide power to the RDK-S2E, do the lights on the Ethernet connector turn on?
2) Have you been done a bootloader update using the LM Flash Programmer tool?
3) Which CCS project are you downloading to the board ?
4) What revision of the Blackhawk XDS100v2 emulator are you using?
Let me know if you have additional questions.
Regards,
-Erick
---------------------------------------------------------------------------------------------------------Please click the Verify Answer button on this post if it answers your question.---------------------------------------------------------------------------------------------------------
Erick,
1) Yes, power is on and the application is working. I am able to start debugging, I get the error message after a couple of step over debug commands. The debugger starts in main and then after I step or run to line, I get the error message every time. I have never been able to set breakpoints outside main.
2) I have not done a bootloader update. I have the application as it came from TI.
3) The project is the ser2enet
4) I just got the blackhawk emulator.They had to get it directly from Blackhawk who was mfging to order.
I want you to perform some tests to check if the Blackhawk emulator is programming the RDK-S2E correctly.
When you connect the Ethernet cable from a router to the RDK-S2E the LEDs should be on. When you click on debug in CCS :
1) Does the Loading Program window appear (similar to the one below):
2) Before you hit run, enable a breakpoint in line 245:
3) Click Resume (F8)
4) Does it stop in the breakpoint or does it give an error in the console?
5) Reset the power on the RDK-S2E board, does the application work as expected?
6) If the application works correctly, add a while(1); at the beginning of main().
7) Click debug to download the software to the board.
8) Click Resume (F8)
9) If you pause the debugger, does it give you an error?
10) Reset the power, do the Ethernet LEDs turn on?
There is another test you can run if you have a Stellaris Evaluation Kit. Instead of using the Blackhawk to program the RDK-S2E, connect the 20 pin connector on the Evaluation kit to the adapter included in the RDK-S2E which connects to the JTAG connector (10 pin) on the board. This will require to change the CCS Target configuration shown below:
- Erick
I have switched gears a bit. I am now evaluating IAR Workbench and JLink debugger instead of CodeCompoaer and Blackhawk.
Interestingly the code fails about in the same spot but using JLink the debugger shows Undefined Instruction (UDF) .
I have commented out the call to
lwIPInit(pucMACAddr, g_sParameters.ulStaticIP, g_sParameters.ulSubnetMask, g_sParameters.ulGatewayIP, ((g_sParameters.ucFlags & CONFIG_FLAG_STATICIP) ? IPADDR_USE_STATIC : IPADDR_USE_DHCP));
and things progress much further.
I kept digging and it seems that once this line executes, the debuggers are not functioning as I would expect them:
EthernetIntEnable(ETH_BASE, ETH_INT_RX | ETH_INT_TX);
I have also observed that the finder utility and telnet ports stop working when debugging. It this expected or should everything work normally when debugging?
The application is not running properly because the CCS and IAR IDEs are not executing the bootloader start up code prior to main as it normally does when the device's power is reset. The application is trying to execute the code inside the Ethernet interrupt handler but since the NVIC table has the incorrect offset it jumps to a wrong address instead.
The Stellaris Boot Loader User's Guide provides more detail to the Startup code in page 9.
Boot Loader User's Guide : http://www.ti.com/litv/pdf/spmu134n#page=9
When the board's power is reset the Nested Vectored Interrupt Controller (NVIC) table resides in the code memory region and has an offset of 0x00000000, assuming the application is written in address 0x00000000. The ser2enet application starts at address 0x00001000, therefore the NVIC table's offset should be 0x00001000. The line of code which sets the NVIC table's offset to 0x00001000 is part of the bootloader start up code which is not being executed when debugging the application in IAR or CCS.
I recommend to add the following line of code to the ser2enet code example to debug your application:
Erick
Thanks for the post. That absolutely resolved my issue.
I had read the doc you mentioned. It does not describe how to use the debugger in this situation.
Our intent for the S2E module is to use the S2E code as a starting point for our new product. We are going to make our own board with the Stellaris micro. The ability to upgrade FW in the field is a requirement. Being able to debug in the lab is also very attractive. No one finds new use cases like QA. So my question is this. Is it possible to have one set of code that can be used for production and be able to debug?
IAR has a feature where you can attach the debugger without flashing. Is this what I am looking for?
John
Glad to hear that you got to debug thecode and that you are moving forward.
john hoffman Is it possible to have one set of code that can be used for production and be able to debug?
Is it possible to have one set of code that can be used for production and be able to debug?
The ser2net code you modified can be used for both production and debugging, in this case you would have an extra line of code to debug your firmware when the application is at address 0x00001000. The binary image created by IAR/CCS will work properly when you upgrade the firmware in the field.
You can also debug your application by removing the line of code I recommended, and moving the start of the application code to 0x0000000 in the linker file.
The following changes are required to start the application at 0x00000000 ( Files located in C:\StellarisWare\boards\rdk-s2e\ser2enet):
IAR linker file (extension .icf) :
//// Define a region for the on-chip flash.//define region FLASH = mem:[from 0x00001000 to 0x000177ff]; change to 0x00000000
CCS linker file (extension .cmd):
#define APP_BASE 0x00001000 change to 0x00000000 #define RAM_BASE 0x20000000
/* System memory map */
MEMORY{ /* Application stored in and executes from internal flash */ FLASH (RX) : origin = APP_BASE, length = 0x00016800 change to 0x00017800
The previous changes would allow you to debug your application without having to add the line of code to initialize the NVIC table, but when you want to do a field update the changes would have to be reversed.
john hoffman IAR has a feature where you can attach the debugger without flashing. Is this what I am looking for?
This feature will not allow you to run the start up code required to initialize the NVIC table, instead you can run the unmodified version of the ser2enet project in CCS (I'm currently running CCSv5.2.0.00044) and download the firmware to the board, click the reset button and then click run your application. The feature to reset and then run does not work in IAR.