This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Warning: Stack pointer is setup to incorrect alignment. Stack addr = 0xFFFFFFFF

Dear all,

I have been working with a nRF51422 device for about two weeks, and everything went good. This morning, out of nothing, i got this error in IAR: Warning: Stack pointer is setup to incorrect alignment. Stack addr = 0xFFFFFFFF

My devboard is the PCA10028.

I've tried looking for other solutions here, but could not find any.

I've tried running nRFgo studio and reflashing the softdevice, the application, but nothing. I've tried running the blinky example, but that does not work either.

Do you have some other suggestions ?

  • after i've programmed the SDK-provided hex-files by copy-ing them to the jlink virtual drive, it started working. blinky works, and also tested hrs example, and it seems the softdevice works as well. but no luck with the UART (that is what i was working on before). any ideas ?

  • on the board, when running the ble_app_uart example, the software does not start.

    the behaviour is very strange, because all the 4 leds on the board are blinking very very slightly (I can barely see them) with a frequency of about 2-3 Hz.

  • I'm not sure what the problem could be, but here are a few of things you can try.

    Check if there is a code assertion:

    • Build without optimization and make sure that debug info is included in output (enable checkbox in project options -> C/C++ Compiler -> Output tab.
    • Add "DEBUG" to the list of pre-processor symbols in project options -> C/C++ Compiler -> preprocessor tab, see "defined symbols" field
    • Start a debug session, place a breakpoint at line ~113 in app_error.c and see if it gets reached. You can read out the error code and line number if it does.

    Make sure that --drv_vector_table_base=0x0 option is used:

    image description

    Try the uart example from a clean copy of the SDK and check if it still fails. Recommend to compare the project options with yours if that works.

  • Thank you for your response!

    Actually, I have just found the problem, and it was not a software, but a hardware problem. For some reason, when I try to power the PCA10028 board from USB, it works only if I hold it in a certain position. I don't know exactly why, because the debugger and the JTag UART don't seem to have problems (so it's not a receptacle/cable problem).

    Nothing reported that it may be a power issue, I just got the stack error mentioned above

    I have manage to solve this by adding an external power supply on the 3V3 line.

    I'm posting this for all of you who experience the same problem, also should try doing this.

  • maybe it's because I use to carry the board with me, and I put it in a plastic box, next to another board (to which I have UART communication) and use the microusb cable to hold them tight inside the box...

Related