STM32L151 Problem

Sysprogs forums Forums VisualGDB STM32L151 Problem

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #6900
    malcolmrook
    Participant

    Hi

    I have a problem with STM32L151RE.

    I had a program which worked with STM32L151RC but had to move to RE as I needed more ram to hold a couple of very large arrays.

    With the STM32L151RE it would not load. (The application was built from scratch to avoid any problems).

    Even the basic flashled project will not load with STLink 2.  It reports unknown chip id! 0x10006437.

    I can load the program with STM32 ST-Link.

    Device ID with STM32 ST-Link is 0x437.

    If I use OpenOCD I am able to load and debug.  However variables declared with a value lose that value when the program runs.

    Any Ideas?

    #6904
    support
    Keymaster

    Hi,

    OpenOCD usually takes a few months to support the latest ST devices. Once it supports it, we will update our package.

    Regarding the problem with the variables, could you please provide an example? Could you also verify that the variable address is within the RAM region according to the datasheet and that the value is actually lost, not just seems to be lost via the debugger (e.g. output it to a COM port from your firmware).

    #6907
    malcolmrook
    Participant

    I would prefer to use the Texane ST-Link debug option not OpenOCD.  Does your comment indicate that Texane ST-Link uses OpenOCD?

    The lost variable values were discovered as GPRS modem messages should have been echoed on a serial port if a ‘debug mode’ flag was set. The flag was set when the variable was declared and no messages were received.   On debugging, I found that the first occasion the flag was checked it had lost its value unless I reset its value after the program start.  Further investigation showed all declared variable values were lost.

    #6910
    support
    Keymaster

    Hi,

    Texane ST-Link is separate from OpenOCD, however it’s also buggier. You can try using it, however you may need to unplug and replug your ST-Link if it starts behaving strangely.

    Can you verify the lost variables problem with the following program?

    int g_Global = 123;
    int main()
    {
        if (g_Global != 123)
            asm("bkpt 255"); 
    }

    Does it trigger the breakpoint? What is the address of g_Global?

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.