diff options
author | Josh Blum <josh@joshknows.com> | 2011-03-26 16:44:53 -0700 |
---|---|---|
committer | Josh Blum <josh@joshknows.com> | 2011-03-26 16:44:53 -0700 |
commit | 0ed7a9f2b0fbd23e68022289fd42af35535bcb39 (patch) | |
tree | 2df31e9d2df38e9ad83739bcd60092edfc8780c8 /firmware | |
parent | 585b0455e8176d8e1abc2722f2a0e56eb89e1c58 (diff) | |
download | uhd-0ed7a9f2b0fbd23e68022289fd42af35535bcb39.tar.gz uhd-0ed7a9f2b0fbd23e68022289fd42af35535bcb39.tar.bz2 uhd-0ed7a9f2b0fbd23e68022289fd42af35535bcb39.zip |
usrp2: fixed serial bootloader for N series
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"); } } |