summaryrefslogtreecommitdiffstats
path: root/firmware/zpu
diff options
context:
space:
mode:
authorJosh Blum <josh@joshknows.com>2011-04-19 17:47:36 -0700
committerJosh Blum <josh@joshknows.com>2011-04-19 17:47:36 -0700
commitfdee3ba82b997c709e6822aa000df8adb61c56a5 (patch)
treeed566f55ef024fd2a45d053a719010e1b2c49366 /firmware/zpu
parentee424d797fc37a8c3c2a82a58218bf1e85456226 (diff)
parent290bb75de236cb53c54bb4599cc2dde924f9800e (diff)
downloaduhd-fdee3ba82b997c709e6822aa000df8adb61c56a5.tar.gz
uhd-fdee3ba82b997c709e6822aa000df8adb61c56a5.tar.bz2
uhd-fdee3ba82b997c709e6822aa000df8adb61c56a5.zip
Merge branch 'master' into next
Conflicts: fpga/usrp2/top/u2plus/Makefile.N200
Diffstat (limited to 'firmware/zpu')
-rw-r--r--firmware/zpu/usrp2p/bootloader/init_bootloader.c11
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 4ae634fb7..d797edce4 100644
--- a/firmware/zpu/usrp2p/bootloader/init_bootloader.c
+++ b/firmware/zpu/usrp2p/bootloader/init_bootloader.c
@@ -42,15 +42,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");
}
}