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.

Using "BS_140s_14x,txt" in MSP430F149 as loadable BSL

Other Parts Discussed in Thread: MSP430F149, MSP430F5438A

Hello,

 

Was anybody able to use the "BS_140s_14x.txt" loadable BSL in MSP430F149 deveice?

Following steps from section 3.5 of SLAU265f I have followed, but whenever I send a command such as RX_Password, or RX_Data_Block or TX_Data_Block, I have always received NAK or 0xA0. I Perform a mass erase before downloading the loadable BSL, so the default password should work.

 

"
3.5 Loadable BSL

For upgrading the BSL functionality, sometimes it is suitable to load a higher version of BSL into the RAM
of a device and apply the latest innovations. To do so, use the following BSL commands:

  1.  RX password (unlock password protection for following commands)
  2.  RX data block (code of loadable BSL, code section address ≥ 220h)
  3.  TX data block (for verification)
  4.  RX data block (get start address from first code section address)
  5.  Load program counter PC (with start address of loadable BSL)
  6.  Wait at least 5 ms until the new loaded BSL has executed the initialized routine
  7.  RX password (unlock password protection for loaded BSL)
  8.  Perform any command (with loaded BSL)

"

I had to skip step 4 is not clear because I am not sure as to what to send to the MSP430F149.

 

I need this loadable BSL becuase the original version 1.1 does not have the Chang_Baud_rate command to communicate at 38400.

 

Thanks in advance for any replies.

 

  • Hi,

    All these looks like valid script instructions to get it working.

    This sounds to me like the sequence to put the MSP430 into BSL mode may not be successful. In short, I have a feeling the BSL is not entering into BSL mode properly. Can you put a scope and see if you're getting the right BSL entry sequence as in Figure 2-3 on SLAU265.

    Couple of questions here:

    1. What hardware are you using to communicate via BSL?
    2. Are you using a TI target board?
    3. What version of BSL_Scripter are you using in your application?

    I am also attaching a BSL_Scripter.exe v1.0.1 that I used for my testing with a newer version of RAM_BSL updater compared to the one that you are using. I got it to work with this basic script. Let me know if you can get this to work.

    Regards,

    William

    149_Download_RAM_BSL_update.zip
  • I can read/write to the MSP430F149 using the patch.txt. The bsl sequence is checked with oscilloscope before. I want to use a RAM based BSL to change the baud rate to 38400.

     

    1. I am using a uart of MSP430F5438A to communicate to msp430F149.
    2. It is a custom board.
    3. I am not sure about  the bsl version scripter.

    I can not use the exe file because the MSP430F149 is connected to MSP430F5438A.

     

    My concern is that the steps to load a RAM based bsl, described in the slau265 appnote, has not been working for me yet.

     

    By the way, all I need are the steps that the scripter exe file is using to download and run the RAM based bsl.

  • I see what you are trying to do now.

    The best suggestion that I could provide is to use the BSL_Scripter.exe source code as a starting point to create a host side firmware for the F5438A. You can use it as a reference point on how functions are defined and etc. There is a folder inside this ZIP file that contains the BSL_Scripter source.

    There is another folder that has the EXE program with the script text. This script text shows how the BSL_Scripter is used to change the F149 baud rate to 38400 using the RAM BSL patch. This is the script that was used:

    INIT_COMM ROM COM1
    INVOKE_BSL
    MASS_ERASE 20
    RX_PASSWORD
    RX_DATA_BLOCK BL_150S_14x.txt
    SET_PC 0x0224
    DELAY 50
    ERASE_CHECK 1100 EEFF
    CHANGE_BAUD_RATE 38400
    RX_DATA_BLOCK Big_File.txt

    Please let me know if this attaching is not being able to download. Or, let me know if you still need more information.

    Regards,

    William

    BSL Scripter.zip
  • Dear William,

    Thank you for your reply.

    I have a few question and concern. The address is shown as 0x0220 in the BL_150s_14x.txt or BS_150s_14x.txt, but the PC is set at 0x0224. Is this an error, or this is how it should be.

    After loading BS_150s_14x.txt, I get an invalid acknowledgement RX_PASS command because the RX_PASS command is stripped off from the BSL (page 23 of SLAU265G.pdf). After loading the BL_150s_14x.txt, I get a valid acknowledgement (0x90) for RX_PASS command. This seems like the RAM based BSL loader may be loading correctly, but they do not understand the RX_data or TX_data Command.

    On page 45 of SLAU265G.pdf, for the BSL version 1.60, the read/write access is byte size for address between (0x0000-0x00FF) and word size for address between (0x0100-0xFFFE). However, for the BSL version 1.10, the read/write access is byte size for the address (0x0000-0xFFFE). Could you please explain more about byte vs word access because I think I may not be accessing the memory in the correct format for address starting 0x1100?

    Thanks in advance for your help.

  • hummingbird said:
    I have a few question and concern. The address is shown as 0x0220 in the BL_150s_14x.txt or BS_150s_14x.txt, but the PC is set at 0x0224. Is this an error, or this is how it should be.

    No this is not an error. At 0x0224, this is where the code starts.

    hummingbird said:
    After loading BS_150s_14x.txt, I get an invalid acknowledgement RX_PASS command because the RX_PASS command is stripped off from the BSL (page 23 of SLAU265G.pdf). After loading the BL_150s_14x.txt, I get a valid acknowledgement (0x90) for RX_PASS command. This seems like the RAM based BSL loader may be loading correctly, but they do not understand the RX_data or TX_data Command.

    I don't think I observed this behavior as I was able to program and read the device using this new BSL. Does it function normally if you don't change the baud rate? Can you monitor the TX and RX line to make sure the baud rate is in spec?

    hummingbird said:
    On page 45 of SLAU265G.pdf, for the BSL version 1.60, the read/write access is byte size for address between (0x0000-0x00FF) and word size for address between (0x0100-0xFFFE). However, for the BSL version 1.10, the read/write access is byte size for the address (0x0000-0xFFFE). Could you please explain more about byte vs word access because I think I may not be accessing the memory in the correct format for address starting 0x1100?

    What this means is that part of the memory map is designed for 8-bits vs 16-bits. Take a look at the 1xx User's Guide Section 1-4. It explains that at memory from 0x000 to 0x00FF, this memory is reserved for byte register peripherals. Memory from 0x0100 and beyond are word register peripherals. I believe this is a typo in the SLAU265 document.

  • hummingbird said:
    On page 45 of SLAU265G.pdf, for the BSL version 1.60, the read/write access is byte size for address between (0x0000-0x00FF) and word size for address between (0x0100-0xFFFE). However, for the BSL version 1.10, the read/write access is byte size for the address (0x0000-0xFFFE). Could you please explain more about byte vs word access because I think I may not be accessing the memory in the correct format for address starting 0x1100?


    Ome of the MSP hardware modules are connected with the address bus only for word-sized transfers. This means they do not decode the lowest address bit but always deliver the 16bit value of the even addresses. If you try to read a single byte from e.g. offset 0x00, this works as expected, reading a byte from offset 0x01, however, will too return the lower 8 bits from the offset 0x00 instead of the higher 8 bits. Similarly, you cannot write a byte to the upper 8 bits of such a register.
    Soem other modules have byte access only. So if you're writing a word to offset 0x00, the upper 8 bits are going into the void and not into the upper half of the register (which would normally be located at offset 0x01). Likewise, reading a 16 bit value from offset 0x00 will NOT contain the content of 0x01 in the upper byte.

    The BSL needs to know these special requirements of some parts of the hardware or you cannot properly read all 'memory' contents. It doesn't make a difference for the FLASH and RAM areas except for a few additional clock cycles if you read them byte-wise. And with the slow UART connection you can't notice the difference. And since you're not realyl debugging through BSL, it's rather a don't care thing.

  • Hi Hummingbird,

    I am using the BS_140s_14x.txt BSL on an MSP430F149. I do the following steps:

    Mass erase (as I don't necessarily know the password), RX password (now all FFs), RX BSL code (in 2 goes as the code is > 256 bytes), Load PC (with address 0x0224 (I think)), wait 5 ms, start RXing my application software to the MSP430.

    I don't do the TX verification step or the second RX password - I'm not sure that the loadable BSL supports the RX password. Also we have just had delivery of the boards where we use the MSP430 and some of the MSP430s have BSL v1.60 on them - we only found that out in the last few days so our PC application that loads the MSP430 application had to be modified to check the BSL version (the get BSL version command doesn't actually work for BSL v1.10 so have to look at 0x0FFA and 0x0FFB to get the BSL version.

    Hope this helps, let me know if not!

**Attention** This is a public forum