In terms of the firmware development, there are 2 major pieces left, which is the message transmission and the display integration. This week, I worked on the message transmission to prep for the interim demo. LoRa message transmission was simulated using 2 Meshtastic nodes, and the messaging interface has been integrated into the UI so that users can select a contact, input a message, and view incoming and outgoing messages.
We are a bit behind on the firmware development as I’d like to be. The physical LoRa integration is still blocked because the module/hardware hasn’t been delivered. The simulation was a mitigation to verify the workflow in software and reduce future integration work. If the module arrives next week and I can finish the physical integration, firmware should be back on schedule.
Next week, I will be prepping for the interim demo and also working on the radio driver and replacing the simulated interface with the physical LoRa module.
This week I was scheduled to work on running the emulator on the dev board, and third-party applications on the emulator.
We have demos during the coming week. Our new PCB got delayed, so our dev boards right now have no display. While seeing tests pass without a screen is meaningful to me, it doesn’t provide a very good demo. Therefore, I’ll show the emulator executing on my laptop for the demo. As a consequence, I’ve prioritized running third-party apps over dev board work, and so I’ll extend that by another week.
We can install apps now! Out of the box, PalmOS stores applications along with other persistent data in half of RAM. Typically, apps are installed over HotSync, which I believe is backed by the VZ’s UART. However, the UART device is not sufficiently fleshed out to use HotSync, and I don’t have a HotSync client. Setting it up would take a great deal of work. On the other hand, we could develop a library that writes the correct database entries to persistent memory without involving PalmOS at all – but this requires digging into implementation-specific behavior.
Fortunately, we can exploit a different well-understood interface: the PalmOS ABI! I mentioned previously that it’s a massive surface to emulate, and that there isn’t really any user/supervisor separation in PalmOS, which is why we aren’t reimplementing the ABI. These disadvantages are actually advantageous here: to install an app, we can inject a sequence of traps into the ABI to persist the app binary! It feels a bit like black magic to hijack the guest OS to upload an app, but it has the least room for error of our options.
For running on the P4, I’ve reworked the system to receive events on channels. That’s sufficient for testing, and for interactive use it will just take a refactor to use FreeRTOS queues instead. I’m not truly processing interrupts yet; I still wait for the last interrupt to finish before delivering the next, regardless of priority. But it works! It also lets me add debouncing, in case e.g. touchscreen interrupts on the P4 are too frequent.
The coming week will focus on pulling a lot of different apps from PalmDB and testing them, to try and smoke out bugs in the implementation. I will also be continuing work on the dev board.
Please enjoy my game of 2048, and politely ignore the parts where I have to stop and think after not having played since 2017 🙂
Previously, we ordered the PCB unassembled and ordered the parts separately, since it was not possible to source the processor directly from JLCPCB. We had done so because we had thought it would be too difficult to use a stencil to apply solder paste to the unassembled portion of the PCB when the rest of the PCB was assembled.
This week, we attempted to assemble the PCB, but although the substitution of the WT0132P4-A1 module for the ESP32 module was a successful solution for easier sourcing and solder paste application, we found that some of the pads for the other ICs were too small to solder ourselves. However, since the stencil came with a lot of extra space around the holes, and the parts that we would need to solder on our own (namely the processor with its associated pull-ups, along with the LoRa module) were limited to one side of the board, we determined that we could cut the stencil and still be able to tape the board in place to apply the solder paste to the unassembled portion. As a result, we decided to reorder the board with most of the components assembled, but solder the through-hole components ourselves, along with the mentioned modules on the left side of the board using the TechSpark reflow oven.
This is a bit of an unfortunate setback- I have used up most of my allocated slack time, which means that I am now slightly behind schedule. We may or may not receive the new PCB by the interim demo, but after that, I should still have a week to test and reorder one more iteration in order for it to arrive by the final demonstration. The larger problem is going overbudget- while we are reusing as many components as possible (along with the stencil) since we already ordered them, the wasted shipping and customs costs for the original fabrication, along with the cost of the parts (namely ICs) that we won’t be able to use, will put us slightly overbudget if we need to make one more order. We will discuss this with our advisor and TA on Monday.
Over the past week, we received our PCBs and the remainder of our components. We’ve also been hard at work on the firmware and software. Overall, we are just about on schedule.
On the hardware side, this week was set aside for testing the PCB, and we ran into a roadblock. We pivoted from purchasing pre-assembled boards to doing all soldering ourselves for cost, but we collectively missed some components that had pads underneath with small pitch. Unfortunately, we do not have enough experience with reflow to guarantee no bridges at small pitches, and pads underneath ICs means that we would need the X-Ray to inspect joints and need a more complex reworking setup than a soldering iron (but the Scorpion in the ECE Fab is currently out of commission). Several things needed to go wrong for us to get here – and fortunately we are prepared for that.
Because of the risk inherent in printing out a PCB, our schedule built in time for a second draft. This was very effective for risk mitigation, because we ran into problems assembling the board. We are adjusting our second draft to be earlier, with the intention of receiving it before our demo. I’ve attached an updated schedule below. However, buying pre-soldered pushes us above our budget; we only have money for printing bare PCBs. This is something we are discussing with course staff.
Firmware development is moving along. Now that more peripherals have arrived, we can develop and test our code more thoroughly. Maggie has been exercising several components on a breadboard and measuring results with the GPS. Now that more time has passed and familiarity has been built, Maggie and Tucker have also been working on clarifying the interfaces and interactions between the hardware, firmware, and emulator. A major risk in our firmware process is the “unknown unknowns” – finding out that a chip has undocumented behavior, or that we did not anticipate a need of the software – and we are mitigating this by validating early.
The emulator is now interactive, performant, and viable for running the OS itself. This week is focused around evaluating it on the dev board, as well as pulling in third-party Palm apps. One major risk remaining is that we did not completely anticipate resource or interface needs of the emulator. Tucker has been measuring it already and designing around the hardware abstractions we specified, giving us an opportunity to discuss and adjust. That will continue this week. There is also a risk of untested Palm apps performing unforeseen actions, and therefore failing to work correctly. PalmOS does not isolate applications or mediate access to hardware; our only mitigations are to implement the emulator with an adversarial mindset and to cast a broad net in our testing.