Free Trials

Download a free trial to find out which Altium software best suits your needs

How to Buy

Contact your local sales office to get started on improving your design environment

Downloads

Download the latest in PCB design and EDA software

  • PCB DESIGN SOFTWARE
  • Altium Designer

    Complete Environment for Schematic + Layout

  • CircuitStudio

    Entry Level, Professional PCB Design Tool

  • CircuitMaker

    Community Based PCB Design Tool

  • NEXUS

    Agile PCB Design For Teams

  • CLOUD PLATFORM
  • Altium 365

    Connecting PCB Design to the Manufacturing Floor

  • COMPONENT MANAGEMENT
  • Altium Concord Pro

    Complete Solution for Library Management

  • Octopart

    Extensive, Easy-to-Use Component Database

  • PRODUCT EXTENSIONS
  • PDN Analyzer

    Natural and Effortless Power Distribution Network Analysis

  • See All Extensions
  • EMBEDDED
  • TASKING

    World-Renowned Technology for Embedded Systems Development

  • TRAININGS
  • Live Courses

    Learn best practices with instructional training available worldwide

  • On-Demand Courses

    Gain comprehensive knowledge without leaving your home or office

  • ONLINE VIEWER
  • Altium 365 Viewer

    View & Share electronic designs in your browser

  • Altium Designer 20

    The most powerful, modern and easy-to-use PCB design tool for professional use

    ALTIUMLIVE

    Annual PCB Design Summit

    • Forum

      Where Altium users and enthusiasts can interact with each other

    • Blog

      Our blog about things that interest us and hopefully you too

    • Ideas

      Submit ideas and vote for new features you want in Altium tools

    • Bug Crunch

      Help make the software better by submitting bugs and voting on what's important

    • Wall

      A stream of events on AltiumLive you follow by participating in or subscribing to

    • Beta Program

      Information about participating in our Beta program and getting early access to Altium tools

    All Resources

    Explore the latest content from blog posts to social media and technical white papers gathered together for your convenience

    Downloads

    Take a look at what download options are available to best suit your needs

    How to Buy

    Contact your local sales office to get started improving your design environment

    • Documentation

      The documentation area is where you can find extensive, versioned information about our software online, for free.

    • Training & Events

      View the schedule and register for training events all around the world and online

    • Design Content

      Browse our vast library of free design content including components, templates and reference designs

    • Webinars

      Attend a live webinar online or get instant access to our on demand series of webinars

    • Support

      Get your questions answered with our variety of direct support and self-service options

    • Technical Papers

      Stay up to date with the latest technology and industry trends with our complete collection of technical white papers.

    • Video Library

      Quick and to-the-point video tutorials to get you started with Altium Designer

    Untangle Yourself with an SD Card Bootloader

    December 6, 2017

    A cable being plugged into a PCB

    Like Ray LaMontagne, I’ve got trouble. Smartphone trouble, trouble, trouble, trouble. I can figure out the apps I want, and I’ve got the games I need (wait, I might have those priorities backward), but transferring all my images and data is a bit more of a pain. There always seem to be music that gets left behind or images that, for whatever reason, refuse to back-up. I consider myself pretty savvy, but when I got a new smartphone I was starting to worry, worry, worry, worry. I couldn’t even imagine if I was trying to transfer data from a larger device—getting all of the files from a hard drive or something larger seems like it would throw me for even more of a loop.

    When I purchased my new smartphone, the sales team helped me out by using a utility app that migrated my data from the old to the new smartphone with ease. I didn’t have to flounder with thirty cords and cables and hunt through all of my collections to determine what was being transferred over anymore. Now take this experience, and apply it to your work: how often do you have to replace the firmware of a microcontroller? And how often do you wish you could avoid that clumsy process of plugging in cables? One way to simplify this process is by using an SD card bootloader.

    Flexible Updating With an SD Card Bootloader

    Conventionally, a microcontroller is programmed using a programming cable. This can become cumbersome and tedious if you are working in a space-restricted environment or if you’re like me and you tend to leave your unfinished tasks hanging out all over the place. Furthermore, it lends itself to outside interference. What if you trip on a cable and knock everything off a table? Or spend several hours trying to figure out why data is not transferring only to realize that the cable simply was not plugged in tightly enough?

    In a microcontroller, a bootloader is a special program that receives the application firmware from an external source and writes it to the internal program memory. It tends to have a small footprint and resides in a reserved section of the program memory. When the microcontroller is powered on and attempts to read the latest firmware present in external media or resources, the bootloader program will erase the existing firmware in the program memory and write the new firmware onto it.

    You could customize your bootloader to obtain its new firmware from serial interfaces, LAN, external media, and more. But my personal preference is for the SD card: it does not need to be a complicated setup on a computer, and it is practically wireless. Using an SD card for your bootloader program turns updating firmware into a matter of inserting the SD card and resetting the microcontroller.

    With a bootloader, updating firmware can be done on the spot and with minimum interruption to the system operation. This feature makes bootloaders, and especially SD card bootloaders, incredibly helpful in embedded systems that may require updating or troubleshooting in the course of their deployment. If the specifications of your firmware may need to evolve with time or update regularly then an SD card bootloader would make the process that much easier.

    Writing code on a computer
    Make sure the microcontroller has space for both the bootloader and the main application.

    Don’t Knock Yourself Down Again

    The main idea behind an SD card bootloader is that the bootloader program is going to read the binary or hex file of the main application from an SD card and write this file into the program memory of the microcontroller. Keeping this central process in mind, here are some other issues to consider:

    Program Memory Allocation: While there are clear benefits of having an SD card bootloader, not all microcontrollers can be loaded with a bootloader program. A bootloader is an application by itself. As such, it does require a certain amount of program memory space that may not be available if you’re using a microcontroller with smaller memory space or your application firmware is too large. Allocate adequate program memory space for both the bootloader and firmware application if you’re planning to incorporate a bootloader.

    Implementing an SD Card Interface: An SD card bootloader will require additional components to be built on your hardware to accommodate the SD card storage. It will incur additional cost if your main application does not require the SD card interface. Besides that, you’ll need to implement the File Allocation Table (FAT32) stack on your bootloader program to ensure that your bootloader program can read the binary or hex file of the new firmware.

    Program Memory Flash Write Sequence: A bootloader basically rewrites a range of address in its internal flash with bytes of information of the application firmware to be loaded. This will require executing the right sequence of command on specific registers to erase and write on the internal flash. Ensure that the right address is being written onto and that the bootloader does not actually erase itself mistakenly.

    Mapping the Binary Files to the Right Address: A normal application is usually written on the starting address of 0x00000000. However, with a bootloader, the starting address of the main application or the bootloader may differ, depending on how they are allocated in the program memory space. Modify the memory link file to ensure that hex files of both programs are compiled for the right memory address.

    Rigorous Testing: The purpose of an SD card bootloader is to simplify firmware updating in the field, not to add unnecessary errors or difficulties to the process. It is important that you test your bootloader thoroughly and ensure that both the bootloader and the main application runs as expected. If the main application is being written improperly or mapped incorrectly you may find that the system will behave erratically.

    Clipboard with a timer, list, and checkmark box checked
    You’ll want to ensure the bootloader is writing the right code at the right space.

    There are other benefits, too, to using a bootloader program aside from quality firmware development. A good hardware design, particularly for the SD card interface, will rule out crosstalk and electrical interference. Altium Designer®’s signal integrity analysis tool may be handy for that.

    Simplify your workspace and make necessary firmware updates flexible and capable of on-the-go processing with a bootloader program. Unlike with smartphones, proper care and set-up for your SD card bootloader program can last you much longer than the few months before another phone upgrade is released. And the best part is you won’t need to call customer assistance each time you need to use it.

    Need more help in designing an SD card bootloader? Get in touch with the experts at Altium now.

    Check out Altium in action...

    Powerful PCB Design

    most recent articles

    Back to Home