uspi icon indicating copy to clipboard operation
uspi copied to clipboard

How to correctly exit a USPI application.

Open Java6502 opened this issue 2 years ago • 1 comments

I am currently in the testing phase for an application that will be using uspi. On my RPI 2B, I have a simple monitor program that allows me to view memory locations, execute code at a particular memory address, and most importantly load code via a serial connection for execution at memory location 0x8000.

Given the keyboard sample included with uspi, I am trying to figure out the correct way to exit the application (break out of the key pressed handler) so I can return from main. Once I return from main I should be in the sysinit.c code, where I should be able to simply ignore the call to halt() and branch to the start location of my monitor program. Currently this doesn't seem to work. My monitor code starts at 0x200000, and I wonder if the memory management of the environment is overwriting the monitor code. Would you be able to provide a memory map usage for the uspi environment.

Just to be clear, my kernel7.img loads my monitor/bootloader, pads a bunch of space and starts executing the monitor code at 0x200000. When I load the sample keyboard program from uspi, the bootloader loads it at 0x8000. I want to basically get out of the program and back to the start of the monitor ready to upload a new sample. I am trying to avoid having to keep unplugging the power to reset the board.

Thanks Jonathan

Java6502 avatar Nov 06 '23 23:11 Java6502

Unfortunately undoing USPiInitialize() and exiting from an USPIEnv application is not implemented and it is not trivial to implement it. Because my focus is now on porting Circle to the new RPi 5, unfortunately I also do not have the time to add this at the moment.

rsta2 avatar Nov 07 '23 07:11 rsta2