12-21-2015 01:15 PM
Hi，I need some help about boot from QSPI. I know altera named our boot-stages as BootROM, Preloader, U-boot or RTOS or Baremetal on 3th stage. I have succeeded to boot from QSPI now. But I want to divide the Baremetal stage into 2 stages to acomplish some other jobs. Stage1:UART burn Program (1)If there is handshake signal from UART,program will receive Uart data stream--"App Pragram data" and write it to QSPI. Uart data stream is tranmited from Uart of PC and this data file is .bin generated by DS-5. (2)If there is no handshake signal,program will read App Pragram data from QSPI and write it to RAM.then jumps to entry point of App Pragram. so,after powerd on,Preloader will load this program,now I can do it. UART burn Program is stored from 0x60000 of QSPI and runs from 0x100040 of DDR. Stage2:App Pragram. ... UART burn Program is stored from 0x160000 of QSPI and runs from 0x200040 of DDR. I have modified .ld file for RAM region. But when program counter jumps from Stage1 to Stage2,App Pragram doesn't run! I simlpy add a jump cmd at the end of Stage1,such as ‘b 0x200000’, and program counter indeed jumps to this address. do I missed something? Thanks!
12-22-2015 01:29 AM
no,they are in different .bin.each .bin in different addresses of Qspi. so preloader only load stage 1 program, then stage 1 program load stage 2 program,and jumps to it. Now, i can run stage 1 program successfully,but not stage2.
12-22-2015 06:25 AM
--- Quote Start --- your bare metal spited stage into 2, is this still under the same *.bin file which located in 0x60000? --- Quote End --- no,they are in different .bin. each .bin in different addresses of Qspi. so preloader only load stage 1 program, then stage 1 program load stage 2 program,and jumps to it. Now, i can run stage 1 program successfully,but not stage2.
12-22-2015 07:47 AM
The first one should be working as that attach to the pre-loader header. But the second one, a bit doubt if can jump to execute another image file by this way.Or maybe to do another checking in the init.d or systemd ?
12-22-2015 10:45 AM
I successfully finished it today !I modifiy my stage1 program based on altera-qspi demo program. There is a function called "system_uinit()" at the end of program. At beginning I modified program counter before the function executes.Stage 2 program fails. now I modified counter after the function executes, stage 2 program runs! i wonder if system_uinit doesn't run,some init functions in stage 2 program fail .