I testet some routines to reset the DSP like Softwarereset with SWRST or WDOG-Timer.
Now i will restart the DSP with a new Bootstream from an another address. The DSP boots from
SPI-Flash and the Bootloader is written @ address 0x00000h. The second Bootloader is laying @ adress 0x20000h.
That is what i have understood of the manual HWR:
If i will reboot my Device, i have to set the BCODE in SYSCR-Register.
If i will make a Software-Reset without start the normal bootsequence. I set the BCODE to 0x01h.
After this instruction, a systemreset is set with the SWRST-register.
If the DSP have finished the Reset, i will reboot.
this i can do withe raise(1), but this is not what i want to do.
I will restart my DSP from SPI like the normal Bootstream. My Firmware lays after the Bootloaderfile.
The 2nd loader should be started at the new adress of the SPI-Flash.
Thats my code:
void swreset(unsigned long ulBootcode)
unsigned long dFlags;
unsigned long i;
dFlags = BFLAG_PERIPHERAL | BFLAG_RETURN;
*pSYSCR |= ulBootcode<<4;
for(i=0;i<100;i++) // Warteschleife von 100 Takten um Systemreset einzuleiten
bfrom_SpiBoot(0x20000, dFlags, 0, NULL);
I´m thinking the raise(1)-instruction will never arrive. The DSP is hanging if i use this code.
So I´m reading the manual again and again. My new idea is to overwrite all important registers for a systemreset.
(I found the OTP, but if i´m right, that´s not the best way to handle.)
SYSCTRL-, SYSCR-, SWRST- and the MMR-Registers are the important register to reboot the DSP from the firmware.
Now the questions:
1. What´s wrong with my code? Did i had forgotten to set important Flags? Have anyone an idea?
2. Are the registers all important register for booting?
3. Can i manually reboot the DSP just with writing the SYSCTRL-, SYSCR-, SWRST- and the MMR-Register?
4. If the OTP-Memory is written with custom settings, can i start the DSP normal with the bootroutine and reset it with entries on OTP-Memory?
Or is that unimportant to do this?