Hardware Overview

Microcontrollers

Commercial Boards

The following is a list of commercial boards that are either ported or planned to be ported to run the nanoFramework

RP2040

The Raspberry Pi Pico is a high-performance microcontroller chip designed by Raspberry Pi in the United Kingdom

The Chip features

  • Dual-core Arm Cortex M0+ processor, flexible clock running up to 133 MHz

  • 264kB of SRAM, and 2MB of on-board flash memory

  • USB 1.1 with device and host support

  • Low-power sleep and dormant modes

  • Drag-and-drop programming using mass storage over USB

  • 26 × multi-function GPIO pins

  • 2 × SPI, 2 × I2C, 2 × UART, 3 × 12-bit ADC, 16 × controllable PWM channels

  • Accurate clock and timer on-chip

  • Temperature sensor

  • Accelerated floating-point libraries on-chip

  • 8 × Programmable I/O (PIO) state machines for custom peripheral support

SWD Debugging the RP2040

To allowing porting the nanoFramework to the RP2040, a native C/C++ debugging facility is required. ( unless you can write perfect code)

There a couple of ways to do this, the following describes the Picoprobe method.

For the complete description you can find the relevant information in the documentation at Getting started with Raspberry Pi Pico in Chapter 6. Debugging with SWD and the Appendix A: Using Picoprobe.

The complete official Picoprobe source can be found at GITHUB.

At the time of starting the porting of the native C/C++ code for nanoFramework to the RP2040 I had the following two boards, the official Pico board and one from Seeed the XIAO RP2040. I decided to use the Seeed XIAO RP2040 board as the picoprobe which only uses a couple of pins.

After downloading the code from GitHub - raspberrypi/picoprobe, I made some modifications to the picoprobe_config.h file to match the GPIO ports I have chosen to connect to the SWD debugging port.

// PIO config
#define PROBE_SM 0
#define PROBE_PIN_OFFSET 28
#define PROBE_PIN_SWCLK PROBE_PIN_OFFSET + 0
#define PROBE_PIN_SWDIO PROBE_PIN_OFFSET + 1

// Target reset config
#define PROBE_PIN_RESET 6
PICOPICOW
image-20230625210611201

STM32F769IDiscovery

This discovery board utilizes the STM32F769NIH6 Arm® Cortex®‑M7 core-based microcontroller with 2 MBytes of flash memory and 532 Kbytes of RAM.

  • 4-inch 800 x 472‑pixel capacitive touch TFT color LCD with serial interface (on STM32F769I-DISCO only)

  • Optional display accessories: HDMI and DSI adapters

  • SAI audio codec

  • Four digital ST MEMS microphones on DFSDM inputs

  • 128‑Mbit SDRAM

  • 512‑Mbit Quad-SPI flash memory

  • Reset and user push-buttons

Pin Outs

CN9

PINGPIO_PORTCONNECTOR PIN
1PC0A0
2PH2A1
3PA0A2
4PA1A3
5PC2A4
6PC3A5

CN8

PINGPIO_PORTCONNECTOR
1PB15D0
2PB14D1
3PG3D2
4PA0D3
5PG4D4
6PE14D5
7PD15D6
8PG5D7

CN5

PINCONNECTOR NAME
1E5V
2IOREF
3NRST
43V3
55V
6GND
7GND
8VIN

CN4

PINGPIO_PORTCONNECTOR NAME
1PE3D8
2PB7D9
3PF6D10
4PF9D11
5PF8D12
6PF7D13
7GND
8AVDD
9I2C_SDA
10I2C_SCL

CN11(Mikrobus)

PINCONNECTOR NAMEPINCONNECTOR NAME
1AN1PWM
2RST2INT
3CS3RX
4SCK4TX
5MISO5SCL
6MOSI6SDA
73V375V
8GND8GND

CN3(Grove)

PINGPIO_PORTSIGNAL
1PF14I2C_SCL
2PF15I2C_SDA
3Vcc
4GND

CN4

PINGPIO_PORTSIGNAL
1PF7RX
2PF9TX
3Vcc
4GND

Arduino

GPIO_PORTSIGNAL
PF14 - I2C4_SCLD15SCL
PF15 - I2C4_SDAD14SDA
AVDDAVDD
GNDGND
5 Volts, 800maPF7 - SPI5_SCKE5VD13SCK
connected to 3.3VD12MISOPF8 - SPI5_MISO
MCU ResetPF9 - TIM32_CH4,SPI5_MOSINRSTD11PWM/MOSI
3.3 Volts, 1.3 AmpsPF6 - TIM32_CH1,SPI5_NSS3V3D10PWM/CS
5 Volt source from one of (E5V,USB,POE)PB7 - TIM4_CH25VD9PWM
GroundPE3GNDD8
GroundGND
External Supply must be < 11.5 VoltsPG5VIND7
PD15 - TIM4_CH4D6PWM
PC0 - ADC123_INP10PE14 - TIM1_CH4A0D5PWM
PH2 - ADC3_INP13PG4A1D4
PA0_C ADC12_INP0PA0 - TIM5_CH4A2D3PWM
PA1_C ADC12_INP1PG3A3D2
PC2_C ADC3_INP0PB14 - USART1_TXA4D1TX
PC3_CPB15 - USART1_RXA5D0RX

Azure-RTOS and startup

When the Azure-RTOS kernel is started, the first call is tx_initialize_low_level.s. The code does not have any specific STM32H7 code and appears to be CORTEX-M common ( to followup). This is where the SysTick frequency is setup as the base timer for the RTOS. There are two variables that define the frequency. SYSTEM_CLOCK = 520000000 <-- This value should be changed to match your CPU clock configuration SYSTICK_CYCLES = ((SYSTEM_CLOCK / 100) -1) The value is setup, see Figure 2