Author Topic: http bootloader  (Read 2587 times)

mg7

  • Newbie
  • *
  • Posts: 10
    • View Profile
http bootloader
« on: June 20, 2012, 02:40:49 PM »
Hello,
Are there size limitations for the firmware files to be loaded with the http (usb?) bootloader?
Thank you.
mg7

netcruze

  • Jr. Member
  • **
  • Posts: 63
    • View Profile
Re: http bootloader
« Reply #1 on: June 21, 2012, 04:42:16 PM »
For a firmware upgrade, the new firmware is uploaded via HTTP or USB Bootloader, and stored in the external FLASH chip. A total of 256kBytes is available for new firmware.

In addition there is also 8kBytes of space for configuration data. This stucture is located in the CFG_STRUCT in the appconf.c file, and placed in the hex file at address 0x800000. When uploading new firmware, the uploader (HTTP, USB bootloader) will check the hex file for data located at this location, and write it to the 8kByte space reserved for the configuration data.

mg7

  • Newbie
  • *
  • Posts: 10
    • View Profile
Re: http bootloader
« Reply #2 on: June 24, 2012, 10:37:25 AM »
In microchip/tcp-ip stack/http2.c I had to replace
Code: [Select]
SPIFlashEraseSector( ((firmwareFlags.flags.bits.bCurr == CURRENT_FIRMWARE_A) ? XFLASH_FIRMWAREB_ADR : XFLASH_FIRMWAREA_ADR) + (curHTTP.data[0]++ * XFLASH_SECTOR_SIZE));with
Code: [Select]
SPIFlashEraseSector( ((firmwareFlags.flags.bits.bCurr == CURRENT_FIRMWARE_A) ? XFLASH_FIRMWAREB_ADR : XFLASH_FIRMWAREA_ADR) + ((DWORD)curHTTP.data[0]++ * (DWORD) XFLASH_SECTOR_SIZE));- otherwise the flash did not get erased properly and my firmware-update did not proceed as expected.

netcruze

  • Jr. Member
  • **
  • Posts: 63
    • View Profile
Re: http bootloader
« Reply #3 on: June 28, 2012, 03:54:29 PM »
Thanks for code! I haven't had any problems yet, but maybe my compiler was different than your, or firmware different size...? Anyway, your suggestion seems like the correct way to do it, and I added it to the code. Next release will be soon, and will add LCD and other commands, and more serialPort (I2C, SPI, USB) functions.