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.

BSL Segment erase command erases bsl

I am using a 5510 device.

I am sending a segment erase command to erase the segment at 0x8000 via the following command:

0x80, 0x04, 0x00, 0x12, 0x00, 0x80, 0x00, 0x97, 0x69

I receive the following from the BSL

0x00

After this any further attempt to communicate with the BSL fails and I need to reprogram the BSL via JTAG in order to get it working again.

Why would an erase of Flash segment starting at 0x8000 cause my BSL to be erased.

I realize that I may not have the BSL protect bits set but it shouldn't matter in this case of a segment erase should it?

Thanks,

Andrew Lucas

 

 

  • Hi,

        That all looks correct, there are just a couple things:

    1) just to be sure... do you first unlock the BSL by sending the password before sending that command?

    2) Do you keep waiting for bytes?  The first 0x00 is an ACK that the packet was received.  There should be more bytes coming back in the form of a BSL Message, saying whether the operation completed with success.

    3) You say further communication fails... does this include if you reset the BSL via the standard invoke sequence?

    4) You mention not setting the BSL protect bits... is this a custom made BSL, or the TI-factory supplied one?  Is there a reason you do not set these bits?

     

  • 1) yes I send the password and it is accepted correctly

    2) yes I wait, but nothing comes

    3) yes I power down, I use the standard invoke sequence and it is complete radio silence, no response

    4) I had to modify the one supplied for the 5438a to work with our 5510, so I guess it is custom.  I actually might be setting the bits, I don't know.  If the code for the 5438a set those bits then I am to.  I just relinked the project for my device.

     

    Having said all of that I have some new information as well.

     

    I sent

    0x80, 0x04, 0x00, 0x12, 0x00, 0x00, 0x80, 0x87, 0xE3 (I swapped AM and AH)

    And this time the BSL replied with

    0x00 0x80 0x02 0x00 0x3b 0x00 0x60 0xc4

    Which seems to indicate success from the BSL.

    The good thing is that I can still talk with the BSL after this command.  I can send this command repeatedly and it reports success.

    My question then is what seqment is being erased?

    Is there a bug in the silicon so that that AM and AH are swapped and I should use AL and AH as my 16 bit address.

    Or should I ignore AL and just use AM and AH as my 16 bit address?

    To further add to this after sending the erase command I tried sending both of the following write commands

    0x80 0x13 0x00 0x10 0x00 0x00 0x80 ... 19 bytes of data plus checksum

    0x80 0x13 0x00 0x10 0x00 0x80 0x00 ... 19 bytes of data plus checksum

    In both cased I received back the following 

    0x00 0x80 0x02 0x00 0x3b 0x01 0x41 0xd4

    The 0x01 means Flash Write Check Failed, indicating to me that the erase actually didn't work, so I don't know where to go from here.

  • Looking at things more closely, I think the problem is that the BSL is set up to run from flash at address 0x8000, so when I went to erase segment 0x8000 I was erasing the BSL.  I don't know why this is.  

    How do I set up the project so that the BSL goes at address 0x1000 where it should?

    I don't think I changed anything with respect to these settings.

    Thanks,

    Andrew 

  • Hi,

      You need to use the custom BSL linker file.  You need to tell your IAR project to use a custom Linker Command FIle, which can usually be found in the CONFIG directory of the example BSLs.  Additionally, don't forget to check the box which allows you download to BSL memory (locted in the FET project options I believe)

  • I am using CCS.

    I changed the FLASH definition line to the following.

    FLASH                   : origin = 0x1042, length = 0x07AE

    It seems to be working now.

     

     

**Attention** This is a public forum