I work with the V1000b on an own 4-Layer-PCB. The programs are in flash.
Everthing runs ok: play .ogg-Fils; work with display; work with Key-Events; USB-Connection
But i have many code. For code space reasons the software is in two separate programs.
Fallowing you can see a small seperation from the complete software.
i have a problem with the functions that copy a new seperate program from flash to the DSP-CODE-RAM
and started it. That doesn't work.
Description: The 1.program only copy the second program in RAM and start it. I can see, that the code is complete in the RAM, but it runs not correctly. If i start the 2.program direct (without 1.program) it works good.
Fallowing you can see the two programs and the batch-file to build it:
______________________________________________________
1.Programm "FW1_Menue.c":
Code: Select all
...
extern struct FsNandPhys fsNandPhys;
extern struct FsPhysical *ph;
void main(void)
{
while (1)
{
((struct FsNandPhys *)ph)->waitns += 40;
ph->Read(ph, 512/512, 8192/512, mallocAreaX, NULL/*minifatBuffer*/);[/i]
((struct FsNandPhys *)ph)->waitns -= 40;
BootFromX(mallocAreaX);
((struct FsNandPhys *)ph)->waitns += 20;
}
}
2.Programm "FW_Player.c":
Code: Select all
...
void main(void)
{
InitMC(); // Initialisierung der IOs
Init();
ScreenClear();
ScreenLocate(20,3);
ScreenPutBigInt(1234,6);
BusyWaitHundreths(100);
...
Build-File:
...
%VSBIN%vcc -P130 -O -fsmall-code -I include -o fw1_menue.o FW1_Menue.c
IF ERRORLEVEL 1 GOTO vccfail
%VSBIN%vcc -P130 -O -fsmall-code -I include -o fw2_player.o FW2_Player.c
IF ERRORLEVEL 1 GOTO vccfail
...
# REM ###### FW1_Menue Link ----------------------------------------------
# echo Linking for Nand Flash loading... (combining with libraries)
%VSBIN%vslink -k -m mem_user -L lib -lc -o fw1_menue.bin lib/c-nand.o lib/rom1000.o fw1_menue.o
IF ERRORLEVEL 1 GOTO linkfail
# REM ###### FW2_Player Link ----------------------------------------------
# echo Linking for Nand Flash loading... (combining with libraries)
%VSBIN%vslink -k -m mem_user -L lib -lc -o fw2_player.bin lib/c-nand.o lib/rom1000.o fw2_player.o
IF ERRORLEVEL 1 GOTO linkfail
# PLAYER.IMG: fw2_player.bin
%VSBIN%coff2nandboot -x 0x50 -n fw2_player.bin FW2_PLAYER.IMG
# MENUE.IMG: fw1_menue.bin
%VSBIN%coff2nandboot -t 3 -b 8 -s 19 -x 0x50 menue.bin FW1_MENUE.IMG
%VSBIN%combineimg -o Output_256M.IMG -m 65536 +0 FW1_MENUE.IMG +512 FW2_PLAYER.IMG
in the Attachment are the complete files
Thank you for your help
Thomas