Skip to main content

Posts

Showing posts from 2019

Ada on a CM33

The CM33 About 2 years ago, ARM released the CM33 to silicon designers. It is designed for IoT but it has a myriad of options that the silicon designer (SD) can choose from. So, at its core its just another CM series processor not unlike a CM4/CM4F/CM7. What differentiates it to a SD are the choices that allow the main extension and security extensions (aka TrustZone). When both of these options are in place and selected by the end user, the CPU looks at one moment like two CM4Fs one secure and one not secure. Of course, the program counter can only be one place at one time so whilst it may indeed look like two cores, only one is really there and it is in this management of the view of the SoC from each of these two spaces that the true colour of the CPU shows. For this discussion of Ada on a CM33, we will assume the CPU starts in TrustZone mode + Main extension. This means that there are two SysTick timers, one for secure(S) and one for non-secure(NS). The CPU registers are only ba...

An Ada Client & Server on the STM32WB55

Ada WB55 Client & Server Following on from the last blog posting, I now have a client and server implementation in Ada. Mine is not quite as fancy as ST's, ST's allows role reversal where the client can run on the larger board (MB1355C) and the server on the USB dongle (MB1293C). I only support server on MB1355C and client on MB1293C. Getting the code & building You will need gnat2018 or gnat2019 from AdaCore: https://www.adacore.com/download Once that's installed, you will need some library code and the STM32 dir I use: git clone https://github.com/morbos/Ada_Drivers_Library.git git clone https://github.com/morbos/embedded-runtimes.git git clone https://github.com/morbos/STM32.git mv ../embedded-runtimes Ada_Drivers_Library cd STM32/WB/WB55/cli_serv_wb55 make Once make finishes you get 2 ELF32 files in the obj/Debug dir. admin@ubuntu_1604:/tmp/STM32/WB/WB55/cli_serv_wb55$ make rm -f obj/Debug/client_wb55x (export LOADER=ROM_WB55x; gprb...

Ada on the STM32WB

STM32WB This is a new part family that merges an L series microcontroller with the BlueNRG-MS controller realized now as a single die. The microcontroller can run at 64Mhz has 1MB of flash and 256KB of ram. The wireless portion (I say wireless since its not limited to BT/BLE but also supports Thread and Zigbee), runs on a Cortex-M0+ controller and shares the top of the 1MB of flash for its (encrypted) FW. The M0's FW size seems about 256KB or so. The CM4F and CM0+ communicate by using some of the 256KB of ram as a mailbox. This is supported by HW (IPCC) that signals interrupts from one side to the other when data is ready. In the past, as on the SensorTile, the BlueNRG-MS was connected by SPI and that was the transport, now its done by mailbox and hw signalling. Ada Can we do it again? Can we get Ada running usefully on an WB series part with the added burden of the new control over BT/BLE? I will save the readers time here to say, yes, its possible! further, its working. He...

Shift on Mips-X

Mips-X Mips-X as described earlier on the blog was a Stanford University grad project. A 32bit RISC CPU with some unique features for one, it had 2 delay slots for control change instructions, branches and jumps. I am not aware of any other processor that has that. We had a visit from John Hennessy (Stanford Mips project faculty lead and ultimately university president) one day (not Mips-X related) and I asked him, "why two delay slots?" his paraphrased answer was "It was a graduate project, we were just trying things out". The Shifter Mips-X had a barrel shifter and exposed it to the programmer via these opcodes: asr    rSRC,rDST,#1..32 rotlb  rSRC1,rSRC2,rDST rotlcb rSRC1,rSRC2,rDST sh     rSRC1,rSRC2,rDST,#1..32 Via a combination of the above, all the needed shift operations could be done. Observe though there is no variable shift , just fixed # shift values. My Shift function Now here is a good puzzle for the reader to parse my varia...

Ada on the ST SensorTile

So my MakeWithAda project is now completed. Here is a video of it: https://youtu.be/E290oAYr0f8 Here is the writeup: https://drive.google.com/open?id=1qYsiKS6nfn8r9OeyOpDvv2cfvY0PysvB Here is the code: https://github.com/morbos/STM32/tree/master/L/L476/sensortile Hackster.io project submission: https://www.hackster.io/hedley-rainnie/ada-sensortile-ed44ed