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.

MSP430F552X Custom BSL link problem in IAR

Other Parts Discussed in Thread: MSP430F5529, MSP430F5528

Hi all,

As we want to have our own USB VID/PID in the bootloader of an msp430f5529 device,I've downloaded slaa450 as a staring point. Without changing anything in code and just building the project "out-of-the-box", it seems that the BSL is already too big to fit within the BSL flash area (using lnk430F5529_BSL_AREA.xcl):

Error[e104]: Failed to fit all segments into specified ranges. Problem discovered in segment CODE. Unable to place 17 block(s) (0x710 byte(s) total) in 
0x703 byte(s) of memory. The problem occurred while processing the segment placement command "-P(CODE)CODE=1014-17EF", where at the moment 
of placement the available memory ranges were "CODE:10ed-17ef"
Error while running Linker

Is it because of a difference in runtime libs or compiler/linker version that the default project does not link?
Is there anything I could do (besides deleting critical code) so the default TI USB BSL actually fits within the BSL area?

My IAR version numbers:
IAR Assembler for MSP430 - 5.10.4 (5.10.4.50168)
IAR C/C++ Compiler for MSP430 - 5.10.4 [Kickstart] (5.10.4.30168)
IAR Library Builder - 4.61T (4.61.20.0)
IAR XLIB - 4.61T/386 (4.61.20.0)
IAR XLINK - 4.61T (4.61.20.0)

Thanks for your help,

Norbert

  • Hello,

       I have reproduced this issue.  It appears that using the newer version of IAR, the code is much larger.  I will investigate further to figure out if there something that can be done, and figure out the root cause of this issue.

  • The BSL code should not use any runtime libs at all.

    I don't know the code, but it is possible that different project settings for the data model or the processor type lead to a larger code (msp430x instructions instead of the smaller msp430 codes). Also, I guess the code was designed for the CCS compiler. IAR might generate different code.
    What about optimization level? Maybe optimize for size should be used rather than optimize for speed. Your code is just 13 bytes too large.

  • Thanks for your answers so far. I hope the code can be squeezed a little bit so it will fit in the BSL area.

  • Optimization is already set to optimize for size by default in the Custom BSL project. I know it's only 13 bytes, but 13 bytes is a lot if the code is already extremely compacted.

  • Hi,

       This is a high priority for me, as it used to fit with the code supplied, but is too big with the newest IAR.  I have written IAR, but was warned that a response would take a while as we are in the summer season and many people are out of office.

       Another option would be to modify the text file directly (look in the "released images" directory) by finding and replacing the VID/PID.  They are just constants, so this should work.  I am against this in general as I think direct modification like this is dangerous, but it appears there is no good solution at the moment.

  • Hi Lane,

     

    I just ran into this problem today using the latest version of IAR Kickstart 6.0 downloaded from TI.com.

    Do you have any solution to this problem yet?  Do you have a CCS version of the 552x BSL?

    I am using the MSP430f5528 and need to customize the BSL for a different XT2 crystal speed.

    Thanks,

    Bob Herman

     

  • Hi,

       As an immediate solution for you, I would recommend removing all code relating to the multiple crystal speeds.  There is a lot of code dedicated to determining the speed of crystal, so if you have a specific one to use, simply remove that and set the registers manually (you might also include a small delay loop, as the xtal scan functions as a delay as well, see the comments in the code).

  • Has there been any update on this issue? I am running into the same issue using the latest version of IAR (v5.20.4).

     

     


     

    Error[e104]: Failed to fit all segments into specified ranges. Problem discovered in segment CODE. Unable to place 17 block(s) (0x70e byte(s) total) in 
    0x703 byte(s) of memory. The problem occurred while processing the segment placement command "-P(CODE)CODE=1014-17EF", where at the moment 
    of placement the available memory ranges were "CODE:10ed-17ef"

     

  • I am running into the same problem.  Has there been any update on this issue?

  • Did you ever find a solution to this? I followed the thread, but it looks like everyone was left hanging without a specific solution. Is it possible to build the BSL on the latest IAR kickstart compiler? I simply need to remove the check for the USB power in the protect function, so I can power my device off a standard charger without the MSP430F5529 entering bootloader mode. I don't want to have to spend a lot of time debugging this code. What's the deal? 

  • It looks like no solution so far. USB BSL code has increased in size from the original one substantially while implementing multiple USB bugs workarounds described in errata documents for MSPs. That's why it looks like even TI itself is struggling to fit bigger USB BSL to the 2KB flash space provided.

    Personally I had to do just binary patching the .txt USB BSL image file. It is quite easy if the modifications are relatively small. I changed VID/PID and BSL 16-word password policy.

  • The thread is 4 years and several IAR versions old. Perhaps the problem vanished with one of the intermediate IAR versions and popped up once more now.
    This is one of the reasons why I’m using a 6 years old compiler version for code that was developed 6 years ago – it was tailored for this compiler and is known to work. When switching to a new compiler, the old code may behave differently or even break.

  • Thanks. I'm aware the thread is very old. However, I have seen many threads out there that appear to be hanging without a solution. Unfortunately, I'm not sure if I can get the old compiler. When you go to IAR's website, it appears that only their latest compiler is available. Also, the primary issue I'm having with the BSL has shown up on other threads, and the only solution was to write a custom BSL. However, there is literally one line of code that needs to be changed on the current BSL, which normally would be a very quick modification. Building and debugging a custom BSL is not an option. Maybe the solution is to move to a new MCU on the next generation of my product.

  • My bad! I didn't look hard enough on the IAR website. They do offer older version of their tools. From what I can tell, the latest version was built with IAR 5.51.5. Is that correct?

  • For Custom BSL 1_00_06_00 (SLAA450C–April 2010–Revised March 2013):

    IAR version used:
    IAR Assembler for MSP430
      5.51.5 (5.51.5.59999)
      C:\Program Files (x86)\IAR Systems\Embedded Workbench 6.4\430\bin\a430.exe
      18/Jan/2013 09:51:10, 2247680 bytes
     

    IAR C/C++ Compiler for MSP430
      5.51.5 (5.51.5.59999)
      C:\Program Files (x86)\IAR Systems\Embedded Workbench 6.4\430\bin\icc430.exe
      18/Jan/2013 09:52:22, 10262528 bytes

    But they are going to charge you full price for older version I believe.

  • Thanks. You're right. I just tried to download this version of IAR, and I have to have a full license in order to download any previous versions or patches. This is kind of unfortunate, since I already have several Code Composer licenses. 

  • Jens-Michael,

    The problem with current TI USB BSL still exists regardless of which toolchain and revision is used. For example, one of the latest BSL revisions we use is BSL00.07.86.36 and it uses 2040 bytes out of 2048 bytes in BSL flash area! What happen if another USB bug will appear and require workaround implemented? Basically there is no space left to add something to it...

  • Hi Serge,

    Do you know if/where I can download the version that you are using? 

    Thanks,

    Steve

  • I use IAR 5.40.1, but I were not able to compile USB BSL code with it, neither I had spare time/money/desire to upgrade/downgrade to another IAR revision. But because required modifications were pretty small - change PID/VID and disable BSL password - I just did binary patching of BSL .txt file.

    It is good that TI provides source for BSL, but you can not even compile it with free KickStart-type tools officially available today! Probably TI should accompany BSL source with corresponding compiler revision :-)

    You may try to get older IAR 5.51 code-limited version somewhere on torrent sites though.

  • If the change is a simple value or such, you may (as Serge suggested) read out the original BSL, locate the value in the binary, change it and write the BSL back. This doesn’t require a compiler at all :)

**Attention** This is a public forum