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.

Custom BSL for F543x

Other Parts Discussed in Thread: MSP430F5438

How do you erase and program the protected Flash segments at 0x1000-0x17FF of F543x?

I attempted but failed to do so with MSP-FET430UIF and KickStart (slac050t.zip). The target chip was a F5438 version L.

I read the following documents:
Ref.1, Data-sheet & Errata for F543x and F541x (slas612.pdf & slaz046a.pdf)
Ref.2, User Guide for F5xx (slau208.pdf)
Ref.3, F5xx Bootstrap Loader (slaa400b.pdf & slaa400b.zip)
Ref.4, FET Tool (slau138k.pdf)

Ref.3 says: "The F543x BSL does not contain a mechanism to unlock the BSL area for erasing and writing a custom BSL. This function is not supported in this version."

I took it to mean one cannot use this version of TI-BSL to erase and write custom BSL. Does it also mean one cannot use JTAG to erase and program the protected segments either? Is it possible to do so with a specially (yet to be) written program in Main-Flash? Is the protection irreversible?

Where can I find more information about the protection mechanism? The references I sited above do not give me enough information.

  • Hi there,

     

    Goto your Project Options --> FET Debugger --> Download tab

    Check the box that says "Allow erase/write access to BSL Flash Memory"

    that should do it.

     

     

    -W

  • Thanks.

    I did what you said. KickStart erased the TI-BSL but failed to write the first byte of my code at 0x1000.

    As a test, my code just try to blink the LED, not realy a custom BSL. Now this chip cannot do the TI-BSL any more (because it is erased). When I involk the BSL sequence with TEST and RST pins, it does not blink the LED either (because even the first byte is not written).

    What should I do now?

  • Sounds like the compiler is not inserting the code at the right memory location. The BSL memory space is between 0x1000 - 0x17FF.

    In this case, it would require you to modify your linker file. Make a copy of lnk430F5438.xcl into your project directory. This file can be found in your IAR insalled folder \430\config\.  You can also rename it if you wish to like lnk430F5438_custom_BSL.xcl.  Then goto Project Options --> Linker --> Config tab --> Check the box that says Linker Command file Override Default and browse for the newly modified linker file.

    In this new linker file, modify 2 lines to reflect it like these

     

    -Z(CODE)CSTART,ISR_CODE=5C00-FF7F            to           -Z(CODE)CSTART,ISR_CODE=1000-17FF,5C00-FF7F


    -P(CODE)CODE=5C00-FF7F,10000-45BFF          to           -P(CODE)CODE=1000-17FF,5C00-FF7F,10000-45BFF

     

    This will essentially force the compiler code to write it to your BSL memory.

     

  • Gentlemen,

    I would like to discourage you from trying to load custom code into the BSL memory space of current MSP430F543x (non-A) devices. The reason is that the current devices have a bug (SYS4, see the device errata sheet under http://www-s.ti.com/sc/techlit/SLAZ046) for which there is basically no workaround. Therefore, programming a custom BSL is not supported. Future device revisions will have this bug fixed and will allow for BSL customization. If a custom bootloader is desired, it needs to be implemented using the device's main Flash memory.

    Regards,
    Andreas

  • Andreas,

    Thank you for your advice.

    Is there a way to restore the TI-BSL?

    I saved the original TI-BSL-Flash content at 0x1000-0x17FF in a file (using -r option of TI-BSL). But BSL-Flash was erased subsequently (see my previous posting in this thread). I can convert that sved file into D43 or other format. But how do I load it to Flash 0x1000-0x17FF?

    -- Lichen Wang

     

  • Lichen,

    according to your earlier post, it seems like the issue is that Kickstart is not able to re-program the BSL memory region. This might be a fundamental tools limitation, possibly by design to prevent exactly what you are trying to do, and probably limitied to MSP430F543x (non-A) devices. Assuming this is true, there won't be an easy way to resurrect your old BSL. Your best bet might be to switch to another device, and refrain from further BSL customization experiments[^o)] 

    Regards,
    Andreas

  • I'm a little confused about custom BSL...
    I also use IAR environment and can not debug BSL_Protect function.

    1. Since the BSL Protect function executes immediately after a reset, on which way is possible
       to bring BSL entry sequence before the examine indication bit in BSL_Protect function.
       Is it possible to bring BSL entry sequence during execution application program?

    2. Also, I do not understand what does mean next code in ZAREA and how I can call BSL_Action0 function?
      JPT __program_start
      JMP BSL_Action0

    3.I changed code in BSL_Protect function, instead jz instruction I put jnz instruction, during examination indication bit.
      I thought, on this way, I will always call BSL and communicate with it? But now I can not program uC with JTAG :(
     


    Please, can you explain me in detail how to go entire execution sequence after
    power up to the calling application and is it possible to debug BSL_Protect function.

    Thanks...

  • Dear Sir,

    when i try to download the Application code to the MSP430F5438 using BSL programmer(BSL_Scripter.exe)

    i am facing following Problem...

    BSL Scripting application 1.06
    The local time is: 12:19 on 30.04.2012
    ------------------------------------------
    Initializing, Mode: 5438 COM: COM1 DONE
    Changing Baud Rate to 9600 DONE
    Mass Erase: FAIL(ee)
    RX Password: FAIL(ee)
    Writing MSP430TB.txt to device: FAIL writing data block starting at 5c00
    CRC from 5c00 of 4096 bytes to 982b FAIL....

    please help me...

    Thank you..

**Attention** This is a public forum