diff options
author | Josh Blum <josh@joshknows.com> | 2011-03-27 04:17:45 -0700 |
---|---|---|
committer | Josh Blum <josh@joshknows.com> | 2011-03-27 04:17:45 -0700 |
commit | feeca81266296b2d20ad9081760a936c3e2ed9c1 (patch) | |
tree | 8c4572ea091ef281f081cce8636cd14d3411be22 /firmware | |
parent | 9a52bc09e3561365c4600fdb9d3df172da014554 (diff) | |
parent | 0ed7a9f2b0fbd23e68022289fd42af35535bcb39 (diff) | |
download | uhd-feeca81266296b2d20ad9081760a936c3e2ed9c1.tar.gz uhd-feeca81266296b2d20ad9081760a936c3e2ed9c1.tar.bz2 uhd-feeca81266296b2d20ad9081760a936c3e2ed9c1.zip |
Merge branch 'fix/usrp_n2xx_serial_bootloader'
Diffstat (limited to 'firmware')
-rw-r--r-- | firmware/zpu/usrp2p/bootloader/init_bootloader.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/firmware/zpu/usrp2p/bootloader/init_bootloader.c b/firmware/zpu/usrp2p/bootloader/init_bootloader.c index f8b432c46..66481eb25 100644 --- a/firmware/zpu/usrp2p/bootloader/init_bootloader.c +++ b/firmware/zpu/usrp2p/bootloader/init_bootloader.c @@ -37,15 +37,16 @@ void load_ihex(void) { //simple IHEX parser to load proper records into RAM. loa gets(buf); if(!ihex_parse(buf, &ihex_record)) { //RAM data record is valid - if(ihex_record.addr >= RAM_BASE) { //it's expecting to see FULLY RELOCATED IHX RECORDS. every address referenced to 0x8000, including vectors. - memcpy((void *) (ihex_record.addr), ihex_record.data, ihex_record.length); - puts("OK"); - } else if(ihex_record.type == 1) { //end of record + if(ihex_record.type == 1) { //end of record puts("OK"); //load main firmware start_program(); puts("ERROR: main image returned! Back in IHEX load mode."); - } else puts("NOK"); //RAM loads do not support extended segment address records (04) -- upper 16 bits are always "0". + } else { + const uint8_t *destination = (uint8_t *)ihex_record.addr + RAM_BASE; + memcpy((void *) destination, ihex_record.data, ihex_record.length); + puts("OK"); + } } else puts("NOK"); } } |