I was lucky
The first idea I had for loading with FEL sort of works.
I made my own bootloader that enables the DRAM and then returns to the FEL program. It does not work the same as the "Linux" version where the loading of the program to test can directly follow in the FEL command, but with two commands it works.
With this bootloader it is possible to start the scope in FEL mode with the DRAM enabled. The FNIRSI startup image is displayed. (Still need to implement my own image
)
sudo ./sunxi-fel -p spl fnirsi_1013d_startup_with_fel.bin
This starts the system and returns to FEL. After this DRAM is enabled and FEL is active.
sudo ./sunxi-fel -p write 0x7FFFFFE0 fnirsi_1013d_scope.bin exe 0x80000000
This command then loads and executes the output of the scope project.
Still needs a SD card with FEL boot to be able to switch between the original scope software and the FEL mode. It is possible to put this new bootloader in the FLASH, but then the original code also needs to be loaded through FEL. This way the SD card and USB code can be tested. But for now it allows for a bit more easy testing of the new code
Tested the latest version of my code and everything works but the sliding menu's are still to slow. So this needs investigating.
The bootloader is in the repository.
https://github.com/pecostm32/FNIRSI-1013D-Hack/tree/main/Test%20code/fnirsi_1013d_startup_with_felEdit: Tried a new idea that came to my mind. I wrote my bootloader to a SD card and stuck it in the scope. It starts with the FNIRSI image and goes into FEL mode. So now I only have to use the second command to test my code.
Wrote it to a SD card with this command. Make sure to change the /dev/sdc to where your SD card shows up.
sudo dd if=fnirsi_1013d_startup_with_fel.bin of=/dev/sdc bs=1024 seek=8