I connect to my Mac many USB devices that communicate over a serial (UART) bus to send debug information to the host or to receive data and code. You know, Raspberry Pi Picos, Adafruit Feathers, FTDI cables — that kind of thing. Often I have more than one connected. Is there an easy way to see what’s connected without listing /dev every time and to remember connected devices’ paths?
This time round, I’ll wrap up my coverage of the key ARMv6-M Thumb instructions and mnemonics that you can use to command the Raspberry Pi RP2040. There are not many instructions left that were not covered in parts one and two, and I won’t be including all the remaining mnemonics, only those you’re likely to use frequently.
A number of the Cortex-M0+ Thumb ops I covered last time update the core’s Program Status Register (PSR) based on the outcome of the operation. The ops that do so have an S appended to their mnemonics and they only work with the core’s ‘low’ registers, R0-7.
When I got my first microcomputer, I already knew Basic programming. My machine had a different Basic dialect from the one I’d learned at school, and there was a stack of graphics and sound functionality to get to grips with too, but it wasn’t long before I felt I’d mastered the high-level stuff and that it was time to move on to machine code. That’s how I’ve come to feel about the Raspberry Pi Pico’s RP2040 chip. The time’s right to learn ARM assembly programming on the Pico.
One of the reasons why an embedded application developer might choose to build their code on top of a real-time operating system like FreeRTOS is to emphasise the event-driven nature of the application. For “events” read data coming in on a serial link or from an I²C peripheral, or a signal to a GPIO from a sensor that a certain threshold has been exceeded. These events are typically announced by interrupting whatever job the host microcontroller is engaged upon, so interrupts are what I’ve chosen to examine next in my exploration of FreeRTOS on the Raspberry Pi RP2040 chip.
FreeRTOS scheduling is hard in as much at can be difficult to decide how to configure it. I wanted to try and figure out the options.
The popular real-time operating system provides the configUSE_TIME_SLICING and configUSE_PREEMPTION as settings values. You can add them to your FreeRTOSConfig.h file Tasks themselves can be assigned priority values, and there are API calls to allows tasks to sleep, to yield up the CPU, and be suspended and subsequently resumed.