P2 Monitor/Debug for possible inclusion in the ROM
Cluso99
Posts: 18,069
This is in case Peter cannot fit TAQOZ into the ROM.
The code runs in hub in hubexec mode and supports Serial I/O on P62&63 as well as various list commands that may be called from a users program.
I have detailed the output in previous thread(s).
https://forums.parallax.com/discussion/comment/1435968/#Comment_1435968
This code requires COG $1E0-$1EF for parameter passing to the hubexec code, and a further 128 bytes somewhere in hub ram for buffer and stack space. Currently this is a fixed location, but is intended to be set as a parameter when the serial code is initialised. The baud is already set by a passed parameter to _SerialInit. This will be a second parameter.
The following calls are supported...
Attached is the code for testing.
Please don't ask for features as I don't have the time for discussion as the ROM closes Friday !!!
The code runs in hub in hubexec mode and supports Serial I/O on P62&63 as well as various list commands that may be called from a users program.
I have detailed the output in previous thread(s).
https://forums.parallax.com/discussion/comment/1435968/#Comment_1435968
This code requires COG $1E0-$1EF for parameter passing to the hubexec code, and a further 128 bytes somewhere in hub ram for buffer and stack space. Currently this is a fixed location, but is intended to be set as a parameter when the serial code is initialised. The baud is already set by a passed parameter to _SerialInit. This will be a second parameter.
The following calls are supported...
_HubTx transmit a serial character _HubTxString transmit a serial string, $0 terminated _HubHex transmit in hex _HubList list cog/lut/hub data _HubRx receive a serial character _HubRxString receive a serial string, <cr> terminated _HubMonitor call the monitor/debug with following command formats [[#]xxxxxxxx] [-] [.yyyyy] [,[$]ccccc] z [m] <cr> [xxxxxx] . [yyyyyy] L <cr> List COG/LUT/HUB from addr1 to addr2 Q <cr> Return to user program ? <cr> Display help WIP [xxxxxx] - [xxxxxxxx] ... <cr> Store to address with data... (will take paste of list output format) To do (time permitting) [xxxxxx] G <cr> Goto address [xxxxxx] . [yyyyyy] , [ccccc] M<cr> Move COG/LUT/HUB from addr1 to addr2 for count #[xxxxxxxx] . [yyyyyy] , [ccccc] M<cr> Fill COG/LUT/HUB with data to addr2 for count
Attached is the code for testing.
Please don't ask for features as I don't have the time for discussion as the ROM closes Friday !!!
spin2
74K
Comments
As far as I understood @chips posts the ROM had to be at OnSemi TODAY (22) and the ROM closed last Friday.
Mike
I am waiting for him to finish with onsemi to finalise the SD Boot for the ROM.
BTW Is anyone actually testing the current P2 v32b code???
I am behind on the debug documentation. Is this needed for the ROM code?
Agreed.
The only other thought was to boot from serial and on another cog run either flash or sd boot. Whichever completed first would stop the other. But this is more complicated and with only days to go might not be worth the risk.
I am not sure where Peter is at with TAQOZ today. I spoke to him over the w/e. In case he's not ready i have been working on a Monitor/Debug that could go in its place.
The boot needs to have fast paths possible into each of UART, SPI, SD.
Fastest entry currently into serial is to continually send a repeating "> Prop_Chk 0 0 0 0 ", and wait for an echo (P2 out of reset) of CR+LF+“Prop_Ver Au”+CR+LF
In the sample program (the cog section) this code will display a piece of code from cog, lut and hub.
Then the user is prompted to enter a string of text terminated with <cr>. <bs> works too, and the characters are echoed.
Next the user program calls the monitor program. Here are some strings to enter to try it out.
The "*" is a prompt character from the monitor.
Most spaces are optional (except in the download where spaces cause the write of the accumulated hex long to be written).
The download format is the same as that output by the "L" list command. pnut outputs with ascii but doesn't have a delimiter quote
I tried to cut and past a line in PST but PST doesn't like it A terminal program would likely work fine.
Please check it works properly.
Please, no requests for added features!
Thanks, but I specifically didn't want to use smartpins in boot code.
It then has to be cleared down, and I didn't want this to be required.
This way, I don't have to worry about interrupts either.
I know Chip has used the smartpin in the boot code.
There are merits both ways. First generation boot loaders needed to be KISS, and so used SW baud.
That also means you have more control over a chip with possible HW faults.
However, Smart pins do allow higher boot baud rates, and that is important.
Smart pins are also now looking mature, with more testing hours on the clock, especially in serial mode...
OnSemi seem to be claiming a high chance of working silicon, and especially of Logic portions, so that risk appears to be lower...
Just looking now at new data on small MCUs that claim up to SysCLK(24MHz)/4 Baud rates.
Ah, here's your init routine, out of the above source file, that uses a couple of Smartpins for the async serial.
Originally I used bit banging back in the first P2.
Guess I must say it's been working for years.
Just realised why I haven't been able to get my monitor running properly/reliably when I insert it into the boot code.
Serial interrupts are still running from the booter trying to autobaud causing weird serial responses
Off to read the manual on clearing interrupts and resetting smart pins
By a "spooky" coincidence I was messing with autobaud stuff today.
Here is Bootloader code that can be downloaded and run...
Try "> " to set autobaud in Chip's code, followed by one of...
<esc> to run TAQOZ
<ctl-d> to boot a file named "_BOOT_P2.BIX" or _"BOOT_P2.BIY" from an SD card
<ctl-e> to run my monitor
The file _BOOT_P2.BIX.spin2 needs to be renamed (remove ".spin2" - forum requirement) and copied to an SD card. It flashes a LED on P5.
This hubmap counts active bytes in 256 byte blocks capped at $FF (=256). The .. are all zeros and each line represents 4kB which is skipped if it is all zeros (unused).
BTW I think all those serial problems were to do with the Interrupt stealing some input characters.
Did you remove, or make the ascii terminal controls optional ?
Am I correct in recalling that TAQOZ interprets the input as it's being entered?
What did you squeeze to save that space?
I removed all the ANSI for starters. I'd like to the SPLAT logic analyzer if I can. Anyone with a terminal can capture port signals and display them easily.
Those commands were built with a group of user callable commands to send characters, hex, string, and read characters, strings, etc. So, it's like a bios for serial. The monitor is just the user friendly (from a command line terminal) section of those calls. I did strip quite a bit of functionality out though.
My understanding is that TAQOZ is more of an alternative language that can be used to test out the hardware. I know Peter is using it to construct real programs but unfortunately I don't expect a lot of users to do this. But it's a great interactive development tool that will hopefully get a lot of people into P2.
Peter has built an amazing piece of code, but it just needs to run at the bottom 64KB.