1 / 26

NET+OS Bootloader

NET+OS Bootloader. Overview Requirements How to Build How to Customize Changes to Applications Configuration Settings. Features. Recovers when flash update fails Application image is compressed Uses DHCP or BOOTP to get an IP address Uses TFTP to download new firmware. Normal Operation.

lulu
Download Presentation

NET+OS Bootloader

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. NET+OS Bootloader • Overview • Requirements • How to Build • How to Customize • Changes to Applications • Configuration Settings

  2. Features • Recovers when flash update fails • Application image is compressed • Uses DHCP or BOOTP to get an IP address • Uses TFTP to download new firmware

  3. Normal Operation • Bootloader always runs at Power Up • Uses standard BSP initialization code • Performs 32-bit CRC checksum of application image • Decompresses Application from flash to RAM • Starts Application

  4. Recovery Mode • Triggered if Application Image fails CRC checksum • Uses DHCP/BOOTP to get an IP address • Uses TFTP to download a new application Image • Writes application image to flash • Resets the unit

  5. Structure of Flash ROM • Bootloader stored in first 64K of flash • Last sector of flash may be used for NVRAM storage • Rest of flash is used to hold application image • Customers can create more sections

  6. Requirements • DHCP or BOOTP Server • TFTP Server • TFTP must be on the same machine as the DHCP/BOOTP server

  7. DHCP/BOOTP Server Setup • Must supply boot filename, which is used as the name of the firmware image to download • Bootloader will reject offers that don’t have a boot filename • Must also supply an IP address • Should supply a gateway and subnet mask

  8. Lock Bootloader Sectors • Booloader image must be written into start of flash at the factory • Sectors that contain the bootloader must be locked at the factory to prevent accidental erasure • Lock method depends on flash part

  9. How to Build for Green Hills • Configure the BSP • Build the BSP • Build the RAM image of the bootloader • Build the ROM image of the bootloader • Bootloader is in netos\src\bootloader

  10. How to Build for MicroCross • Configure the BSP • Build the BSP • Build “make all” in the bootloader directory

  11. How to Customize • Customization hooks in customize.c • Customize.c contains a default implementation of the bootloader • Custom features are added by modifying functions in customize.c • These functions were written to be easy to customize

  12. Example static char *getDefaultFilename(void) { static char *defaultFilename = ""; return defaultFilename; }

  13. How to Change default Filename • Default filename is sent to DHCP/BOOTP server as a hint about what file the unit wants to download • Standard implementation is to send an empty string • Change getDefaultFilename() to supply a default boot filename

  14. Change Error Reporting • Default implementation blinks LEDs in a pattern to indicate error condition • Edit reportError() to change this

  15. Determine when to Update Image • Default implementation is to update the image if it fails a 32-bit CRC checksum test • Might want to look at buttons or switches too • Change shouldDownloadImage()

  16. Determine if Image is Valid • Need to determine if image downloaded from TFTP server is valid • Default implementation performs a 32-bit CRC checksum of it • Might need to prevent users from upgrading cheap units with firmware from expensive ones • Edit isImageValid()

  17. Might not want to use DHCP • Default implementation uses DHCP/BOOTP to get an IP address and name of TFTP image to download • Might want to get this information in a different way • Can change downloadImage() to do this

  18. Exchanging Additional Information • May want to send additional information to the DHCP server, or have it send additional information to the unit • Can customize downloadImage() to send Vendor Class ID (60) to DHCP server • DHCP server can send Vendor Info (43) to unit

  19. Changes to NAFTPAPP • NAFTPAPP looks at filename to determine where to write image into flash • Image.bin is written into application image space in flash • Rom.bin is written to start of flash

  20. Changes to Applications • Debug, romzip, and ramzip images are gone • The “Image” image replaces all of them • Creates debug version that corresponds to the image the bootloader will execute • Also creates compressed version that can be written to flash and executed by the bootloader

  21. Structure of Application Image • Image that is written to flash has a header • Header is created by boothdr.exe • Image is usually compressed • Generated automatically when “image” is generated

  22. Boothdr.exe • Used to generate image that is written to flash • Adds header and 32-bit CRC checksum • Compresses application image boothdr <config> <in> <out> [<custom header>]

  23. Boothdr Config File • Used to set values in bootloader header • Default version stored in linkerScripts\bootldr.dat • Customers can override this by editing build or make files to use a different one

  24. Default Boothdr Config File WriteToFlash Yes Compressed Yes ExecuteFromRom No flashOffset 0x10000 ramAddress 0x800000 MaxFileSize 0xD0000

  25. Customized Headers • Customers can append their own headers onto the bootloader header • Useful for identifying the H/W requirements of the firmware • Custom header is appended by adding the name of a header file onto the command line used by boothdr.

  26. New BSPCONF.H Settings • BSP_BOOTLOADER_SIZE determines the size of the bootloader image in flash • BSP_APPLICATION_OFFSET determines where the application image starts in flash • BSP_APPLICATION_IMAGE_SIZE determines the maximum size of the application image in flash

More Related