This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Concerto initialization problem? Program goes into weeds, but works after Restart.



Hello,

I am modifying the Concerto LWIP example to configure the IOs for my board (new PCB, not ControlCard).

When I run it in debug the first time, and hit the "run" button, it crashes at random lines while writing to config registers, but always goes off into the weeds to the same place (Program Counter = 0x010037F8, Stack Pointer seems corrupt =  ) and gets stuck in a little loop.

After I click the "Restart" button, the program will execute correctly.

Question #1)  Am I missing some sort of initialization/sequence/reset?

Question #2)  Where the heck is 0x010037F8?  From what I've read about the system memory map on this chip, that address doesn't even exist, yet the debugger is showing disassembly and showing code execution there.  What's going on?

 

Thanks,
-Will 

  • Hi WIll,

    Will Flanery said:

    I am modifying the Concerto LWIP example to configure the IOs for my board (new PCB, not ControlCard).

    When I run it in debug the first time, and hit the "run" button, it crashes at random lines while writing to config registers, but always goes off into the weeds to the same place (Program Counter = 0x010037F8, Stack Pointer seems corrupt =  ) and gets stuck in a little loop.

    After I click the "Restart" button, the program will execute correctly.

    Question #1)  Am I missing some sort of initialization/sequence/reset?

     

    The above behavior normally happens when you try to write to some peripheral registers without enabling the peripheral properly. Make sure the peripheral is out of reset and clocking to peripheral is enabled. In other words make sure you use SysCtrlPeripheralEnable() function properly.

    Will Flanery said:

    Question #2)  Where the heck is 0x010037F8?  From what I've read about the system memory map on this chip, that address doesn't even exist, yet the debugger is showing disassembly and showing code execution there.  What's going on?

     

    That belongs to boot ROM memory. Boot ROM is dual mapped at 0x00000000 and at 0x01000000. This is mentioned in the boot ROM chapter of latest TRM. I assume your device is getting reset and executing through boot ROM or it never started your application.

    please refer to boot ROM chapter of Technical Reference Manual to help you debug waht is going on.

     

    Best Regards

    Santosh

     

  • Enabling the peripherals' clocks before writing to the registers solved the crash.

    Thank you.