Skip to main content
kevin239955_st
Associate III
January 29, 2015
Question

Flash Memory Boot

  • January 29, 2015
  • 24 replies
  • 4079 views
Posted on January 29, 2015 at 13:56

Hi

Section 6.1.1 of the SPC560x Reference Manual says that ''in order to successfully boot from flash memory, you must program two 32-bit fields into one of 5 possible boot blocks.''

I have written 0x005A005A to address 0x00000000 accordingly (on our SPC56B Discovery Kit) but neglected to program a valid 32-bit reset vector. Now the board is stuck in reset (I can't even connect the JTAG probe).

Is there any way of resolving this? Not just to ''unbrick'' the development hardware but if this were to happen ''in the field''.

Thanks

Kevin
    This topic has been closed for replies.

    24 replies

    kevin239955_st
    Associate III
    February 24, 2015
    Posted on February 24, 2015 at 17:48

    With the correct boot address (0x00000008) the Discovery board still does not boot without stimulus from JTAG. Is there another jumper setting somewhere that I am missing? Memory dump attached.

    Thanks

    Kevin

    ________________

    Attachments :

    Boot_Sector_0_Dump.txt : https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006I0J1&d=%2Fa%2F0X0000000ba1%2F_NDuEhStJFEdEPnUFmk4ej_6R4nuhU1wrOFesXejcuM&asPdf=false
    Erwan YVIN
    ST Employee
    February 25, 2015
    Posted on February 25, 2015 at 14:15

    Hello Kevin ,

    your bootaddress seems to be correct 0x00000008.

    in our repository application ..but after it does not match 

    in our application : 

    0xE904 should be a branch into  _coreinit (0x10)

    0xE959 should be a branch  _ivinit (0xBC)

    After a Branch  _boot_address (0x00000130)

    is it possible for you to break on the address 0x00000000 or 0x00000008 ?

    is it an Application repository ?

      Best regards

                Erwan

    kevin239955_st
    Associate III
    February 25, 2015
    Posted on February 25, 2015 at 14:57

    Erwan

    We are not using SPC5Studio code, this is our own ''bare metal'' software (this is a high integrity avionics application).

    I can break on 0x00000008 but not on 0x00000000. If I run the program using a JTAG reset (and ''Start Program Execution'' in UDE) it executes correctly. But if I remove power to the board and re-power without JTAG it does not boot from Flash as expected.

    Kevin

    Erwan YVIN
    ST Employee
    February 26, 2015
    Posted on February 26, 2015 at 14:29

    Hello Kevin ,

    Our BOOT_ID is set to 0x015A0000

    did you reset your jumper PA8 and PA9 to 0 after ''unbrick'' your discovery board ?

    PA8 and PA9 to 0 means ''Flash Memory Boot by default.''

    Best regards

     

                          Erwan

    kevin239955_st
    Associate III
    February 26, 2015
    Posted on February 26, 2015 at 16:54

    Erwan

    Our Boot Id is also now 0x015A0000.

    PA8 and PA9 are back to 0 since the ''unbrickening''. I've also tried the same software on another board which is fresh in its default (factory) configuration with the same result.

    If I reset the board with JTAG and then disconnect the code runs. But still if I power the board without JTAG the board looks as if it is stuck in reset.

    Do you have a simple test Flash build I could try out? 

    Kevin

    Erwan YVIN
    ST Employee
    February 26, 2015
    Posted on February 26, 2015 at 17:23

    Hello Kevin ,

    Could you try the application in SPC5Studio environment from the application wizard ?

    SPC560Bxx OS-Less Test Application for Discovery (LED blinking)

    Generate , Compile and debug (in order to flash)

    Best regards

                          Erwan

    kevin239955_st
    Associate III
    March 2, 2015
    Posted on March 02, 2015 at 15:36

    Erwan

    I have tried the image programmed into the board from factory (flashing LED example). This boots from Flash as expected. One of the differences between this and my image is that the factory build does not start with VLE instructions. Is this a limitation?

    Thanks

    Kevin

    kevin239955_st
    Associate III
    March 2, 2015
    Posted on March 02, 2015 at 18:07

    Erwan

    Slight update on the above: our code isn't disabling the (SWT) watchdog on startup. I think this may be the problem...

    Kevin

    Erwan YVIN
    ST Employee
    March 2, 2015
    Posted on March 02, 2015 at 18:46

    Hello Kevin ,

    Warning, the device BXX supports only the VLE mode.

    Anyway , for the WD, it is on the Debugger configuration after the Reset

    // disable watchdog

    SET SWT_SR 0xC520

    SET SWT_SR 0xD928

    SET SWT_CR 0xFF00000A

    Best Regards

                          Erwan

    kevin239955_st
    Associate III
    March 9, 2015
    Posted on March 09, 2015 at 18:03

    Thanks Erwan. Disabling the watchdog stops the resets.

    But I/O does not function until I connect the debugger. If I remove the script from the UDE connection's ''Execute Initialisation Commands on reset'' but leave the box ticked the I/O (GPIOs flashing) works fine. Without the box ticked there are no flashing LEDs (although the code is running). There must be something else enabled by the debugger to set up I/O. I'll have a look through the manual but in the meantime if there's anything obvious I should look at please let me know.