• Join
  • Sign In with my.TI Login
Texas Instruments
  • Products
  • Applications
  • Tools & Software
  • Support & Community
  • Sample & Buy
  • About TI
Sample & Purchase Cart Sample & Purchase Cart
  • Search
  • Advanced
TI E2E™ Community
  • Support Forums
  • Blogs
  • Groups
  • Videos
  • 简体中文
  • More ...
TI Home » TI E2E Community » Support Forums » Microcontrollers » MSP430™ Microcontrollers » MSP430 Ultra-Low Power 16-bit Microcontroller Forum » Separate BSL and application codes
Share
MSP430™ Microcontrollers
  • Forum
  • Announcements
  • E2E Wiki
Options
  • Subscribe via RSS
MSP430 Resources
  • MSP430 Product Folder
  • MSP-EXP430G2 - MSP430 LaunchPad Value Line Development kit
  • MSP430 Getting Started Guide
  • MSP430 Microcontroller Projects
  • More Resources >
  • Forums

    Separate BSL and application codes

    This question is not answered
    Nils Jarnberg
    Posted by Nils Jarnberg
    on Apr 25 2012 10:46 AM
    Prodigy50 points

    I like to implement the ‘Overall guidelines for ROM-based BSL (1xx, 2xx and 4xx Devices)’, from the TI wiki:

    http://processors.wiki.ti.com/index.php/BSL_(MSP430)

    However it is not clear to me how to separate the BSL code and the application code, and how to protect the BSL code from being erased.

    Is there any code example that I can start with? Or is there a suitable application report that you can recommend?

    I am working on a 4xx unit, if that matters.

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    All Replies
    • old_cow_yellow
      Posted by old_cow_yellow
      on Apr 25 2012 11:10 AM
      Guru25815 points

      If you are working on a 4xx, BSL is in the BSL-ROM of the chip. Application code can only reside in Flash or RAM. Both Flash and RAM are separated from the BSL-ROM. And ROM cannot be erased.

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • Nils Jarnberg
      Posted by Nils Jarnberg
      on Apr 26 2012 10:27 AM
      Prodigy50 points

      Yes I know, the BSL code is on the ROM, see wiki link above. I would like to do what's in the wiki, and I don't know how to separate 'myBSL code' (invoking the BSL from software) and the application code on the flash. Perhaps this is a bit more to the point. Please read the wiki, it's no point of having me reciting it.

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • old_cow_yellow
      Posted by old_cow_yellow
      on Apr 26 2012 12:49 PM
      Guru25815 points

      I did not read the wiki before. I think the entire Section 3: Overall Guidelines for ROM-based BSL (1xx,2xx and 4xx Devices) does not make any sense under that heading.  I think they should be under the heading: Custom MSP430 BSL for 1xx/2xx/4xx Devices.

      For 1xx, 2xx and 4xx, there is a ROM-based BSL in ROM. It is already protected and it is already separated from the application. If you want to implement a Custom BSL in Flash, then you have to think about how to protect it and how to separate form the application.

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • Nils Jarnberg
      Posted by Nils Jarnberg
      on May 03 2012 07:13 AM
      Prodigy50 points

      I just like to implement what's in the wiki, Section 3: Overall Guidelines for ROM-based BSL (1xx,2xx and 4xx Devices). Any suggestions how to do this? 

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • Derek Belle
      Posted by Derek Belle
      on May 03 2012 17:07 PM
      Intellectual495 points

      I am currently trying to do this as well. 

      I am using a 2619 and have a very limited pin out.

      From what I gather from the wiki, is that you make a custom bsl section in the linker command file, then when (lets say the UART) recieves the command "Firmware Update" it starts the users firmware update code: ie you make some protocol and erase the flash that you want and reprogram it from the .hex file information streaming in from the UART. 

      At least that it what it seems like...

      If I get anywhere with this today I will post up my code.

      Derek 

      bsl msp430
      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • Derek Belle
      Posted by Derek Belle
      on May 03 2012 21:36 PM
      Intellectual495 points

      Ok well after reading the program "appl.c"  it is a little more appearent how to impliment this. 

      If you download the CUSTOM_BSL_APP.zip and CUSTOM_BSL.zip. files from the wiki page it goes through everything. 

      I will attempt this again when I am actually at my desk for the day.

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • Derek Belle
      Posted by Derek Belle
      on May 05 2012 03:26 AM
      Intellectual495 points

      I have played with this quite a bit and cant seem to get a working version. 

      I set up a system like in appl.c in which I separate the flash memory (f2419-two flash memory sections) and go to the address where the "bootloader" is located. 

      In the bootloader I manually put in a string[] that contains the contents of a ti-hex file.

      The problem with this is that when you erase the flash you loose the c_int00 information. I tried a few ways around this but I could not get it to cooporate. 

      There is also a bug of some sort in the rts library, since I could not install manually a c_int00 section into the linker file without getting errors. 

      Then I found some one on the e2e forum saying that you needed to make the "bootloader" into two seperate projects. http://e2e.ti.com/support/microcontrollers/msp43016-bit_ultra-low_power_mcus/f/166/t/47205.aspx

      I did this and found that when I would jump to my custom "bootloader" it would not execute the code. 

      There seems to be quite a few threads on this, but there are no concrete examples anywhere to be found.

      Anyone have any comments on this?

      c_int00 issues bsl msp430 bootloader 2xx 1xx 4xx
      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • old_cow_yellow
      Posted by old_cow_yellow
      on May 05 2012 11:00 AM
      Guru25815 points

      Derek,

      The immediate problem you are facing is the limitation (or "feature") of the tool you are using. What are you using? And in c or assembly? The limitation (or "feature") can be worked around.

      Once you managed to load both your Application and your BSL in Flash (at separated segments), how do you decide which one to run after Reset? And how to switch to the other one?

      --OCY

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • Derek Belle
      Posted by Derek Belle
      on May 07 2012 12:54 PM
      Intellectual495 points

      I have been pondering this as well. My immediate thought is that I make  a custom reset vector for the BSL that is called by software. Then have get the run time enviroment up and running. That seems to be the tricky part. Oh and I am writing in C.

      The only other issue with that I am finding so far is syntax. I can not seem to get it to work in the Linker file. (With the C2000 I can do this, but I get an error with the 430)

       

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • old_cow_yellow
      Posted by old_cow_yellow
      on May 09 2012 15:26 PM
      Guru25815 points

      I wonder why people would want to follow the ‘Overall guidelines for ROM-based BSL (1xx, 2xx and 4xx Devices)’, from the TI wiki: http://processors.wiki.ti.com/index.php/BSL_(MSP430)

      That guideline essentially says:

      (1) Those devices have a ROM-based BSL But ignore that BSL and roll your own BSL.

      (2) Your own BSL will only start if the CRC check of your Application is incorrect. Otherwise your Application will automatically start.

      This seems to mean:

      (a) Overall speaking, the ROM-bases BSL is worthless.

      (b) The CRC check of our Application may corrupt and at that time your BSL can reload your Application.

      (c) Other than that situation, if you want to run your BSL, you have to wait (or cause) a CRC check of your Application.

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • Derek Belle
      Posted by Derek Belle
      on May 09 2012 19:08 PM
      Intellectual495 points

      I will post up a more thorough post later, but I got two seperate projects running on one chip. Now I just have to implement the UART to the bootloader/monitor project to load the data into the sections that are being reflashed. 

      I will post my code when I get the custom BSL finished.

      bsl msp430 linker
      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • Jens-Michael Gross
      Posted by Jens-Michael Gross
      on May 10 2012 08:55 AM
      Guru140650 points

      old_cow_yellow
      Overall speaking, the ROM-bases BSL is worthless.

      Not that's not a conclusion but a prerequisite for needing an own BSL. Mostly because you want a different kind of interface than provided by the rom-based BSL. Even then, the rom-based BSL isn't worthless, it just doesn't suit your needs.

      old_cow_yellow
      Other than that situation, if you want to run your BSL, you have to wait (or cause) a CRC check of your Application.

      Yes, that's the weak part. However, you can simply define an input pin as a 'force BSL' pin. If it is tied to GND by a jumper on startup, the BSL will always start. If you cannot come up with a simple solution such as this, you shouldn't try implementing your own BSL at all.
      I agree that this could have been added to the guidelines.

      _____________________________________
      Before posting bug reports or ask for help, do at least quick scan over this article. It applies to any kind of problem reporting. On any forum. And/or look here.
      If you cannot discuss your problem in the public, feel free to start a private conversation: click on my name and then 'start conversation'. But please do so only if you really cannot do it in a public thread, as I usually read all threads. And I prefer to answer where others can profit from it (or contribute to it) too.

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • TonyKao
      Posted by TonyKao
      on May 10 2012 14:14 PM
      Genius3770 points

      The whole section should be rewritten, since as it stands there's no mention of actually using the ROM BSL anywhere. And the "guidelines " seem to be a hodgepodge of things for ROM and custom BSL.

      Tony

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    TI E2E™ Community
    • Support Forums
    • Blogs
    • Videos
    • Groups
    • Site Support & Feedback
    • Settings
    TI E2E™ Community Groups
    • TI University Program
    • Make the Switch
    • Microcontroller Projects
    • Motor Drive & Control
    Other Communities
    • Deyisupport
    • Designsomething.org
    • beagleboard.org
    • TI on Element 14
    • TI on TechXchangeSM
    Other Technical & Support Resources
    • WEBENCH® Design Center
    • Product Information Centers
    • Technical Documents
    • TI Design Network
    • TI Technical Articles
    • TI Training

    All content and materials on this site are provided "as is". TI and its respective suppliers and providers of content make no representations about the suitability of these materials for any purpose and disclaim all warranties and conditions with regard to these materials, including but not limited to all implied warranties and conditions of merchantability, fitness for a particular purpose, title and non-infringement of any third party intellectual property right. TI and its respective suppliers and providers of content make no representations about the suitability of these materials for any purpose and disclaim all warranties and conditions with respect to these materials. No license, either express or implied, by estoppel or otherwise, is granted by TI. Use of the information on this site may require a license from a third party, or a license from TI.

    Content on this site may contain or be subject to specific guidelines or limitations on use. All postings and use of the content on this site are subject to the Terms of Use of the site; third parties using this content agree to abide by any limitations or guidelines and to comply with the Terms of Use of this site. TI, its suppliers and providers of content reserve the right to make corrections, deletions, modifications, enhancements, improvements and other changes to the content and materials, its products, programs and services at any time or to move or discontinue any content, products, programs, or services without notice.

    Follow Us Texas Instruments on Facebook Texas Instruments on Twitter Texas Instruments on LinkedIn Texas Instruments on Google+
    TI Worldwide | Contact Us | my.TI Login | Site Map | Corporate Citizenship | mobile m.ti.com (Mobile Version)

    TI is a global semiconductor design and manufacturing company. Innovate with 100,000+ analog ICs and
    embedded processors, along with software, tools and the industry’s largest sales/support staff.

    © Copyright 1995-2013 Texas Instruments Incorporated. All rights reserved.
    Trademarks | Privacy Policy | Terms of Use