Using the Pico with Kooka Firmware

The latest Kooka Firmware release, compatible with Kookaberry V2 Series modules, Raspberry Pi Pico, and RP2040 modules, is now available on GitHub. This firmware, based on MicroPython for RP2040 microcontrollers, is supported by KookaSuite, including KookaBlockly (visual Blockly IDE) and KookaIDE (scripting IDE with MicroPython REPL access).

Key features of the Kooka Firmware include built-in library functions for various functionalities such as display, timing, clocks, buttons, LEDs, sensors (e.g., LSM303 accelerometer/magnetometer, temperature, soil moisture), power probes, radios, servo motors, data logging, and more.

Click on the green button to get firmware from GitHub

Scroll to the bottom of the page where you will find a link to a zip file containing Kooka firmware files. As @ March 2024, the firmware is at V1.10.0

Download the file, unzip, and you will see two folders  rp2040 and stm32.

Extract the following two files from the rp2040 folder – kooka_rp2040.bin, and kooka_rp2040_mboot.uf2

Install

  1. Load the bootloader (kooka_rp2040_mboot.uf2) onto the Pico by depowering the board, holding down BOOTSEL during power-up, and dragging/dropping the file onto the Pico’s USB drive.
  2. Restart the Pico; the drive will now be named “KOOKABERRY.”
  3. Open the KOOKABERRY drive, drag/drop the kooka_rp2040.bin file to the root directory, and depower/repower the Pico.
  4. The green LED on the Pico will flash during the loading process, and two folders (“app” and “lib”) will appear in the KOOKABERRY drive after loading is complete.

Raspberry Pi RP2040 pin assignments in the Pico

Raspberry Pi has pre-assigned four GPIO RP2040 pin functions internal to the Pico Board and the Pico
board only exposes 26 of the possible 30 RP2040 microprocessor pins. See Raspberry Pi Pico Datasheet at
https://www.raspberrypi.com/documentation/microcontrollers/raspberry-pi-pico.html

The Pico internal pin assignments are :

  • GPIO 23 – This is used internal to the Pico board for Power Control and its use changes the on-board regulator between Pulse Frequency Modulation to Pulse Width Modulation
  • GPIO 24 – This is used to monitor the state of VBUS
  • GPIO 25 – An on-board Green LED is connected pin
  • GPIO 29 – VSYS is monitored internally on the Pico and connected to ADC3

Kookaberry RP2040 GPIO pin assignments

The Raspberry Pi Pico has preset functions for four GPIO RP2040 pins, with 26 pins exposed on the Pico board out of 30 possibilities. Check the Pico Datasheet at https://www.raspberrypi.com/documentation/microcontrollers/raspberry-pi-pico.html for details.

Key internal pin assignments on Raspberry Pi Pico include:

  • GPIO 23: Used for Power Control, affecting the onboard regulator.
  • GPIO 24: Monitors the state of VBUS.
  • GPIO 25: Connected to an onboard Green LED.
  • GPIO 29: Monitors VSYS internally and connects to ADC3.

For Kookaberry V2 series modules, based on Raspberry Pi RP2040, 11 GPIO pins are pre-assigned for onboard peripherals in the Kooka Firmware:

  • GPIO 0, 1, 2, 3: Nordic nRF52 packet radio SPI Bus.
  • GPIO 21, 22: Nordic nRF52 packet radio SWCLK and SWDIO.
  • GPIO 18, 19: LSM303 Accelerometer/Magnetometer I2C SCL/SDA.
  • GPIO 2, 3, 7, 20: Blue OLED 128×64 Display (sh1106 controller) – SPI Bus.
  • GPIO 6: Software RESET.

Note: Access virtual Kookaberry display, LEDs, and buttons using the ‘show display’ function in the KookaSuite IDE.

The Kooka Firmware thus reserves some RP2040 microprocessor pin assignments for Kookaberry V2 functionality and makes available 16 Pico GPIO pin functions of the RP2040 for external use.  The unreserved GPIO pins on the Pico are supported by the KookaSuite IDE.  

Available GPIO pins on the Pico when the Kooka Firmware is used :

GPIO4GP4
GPIO5GP5
GPIO8GP8
GPIO9GP9
GPIO10GP10
GPIO11GP11
GPIO12GP12P3B
GPIO13GP13P3A
GPIO14GP14
GPIO15GP15
GPIO16GP16
GPIO17GP17
GPIO26GP26P1
GPIO27GP27P2
GPIO28GP28P4
GPIO29GP29P5 [Note]
Note: Only if made available – see Pico reserved pins

See mapping table below

The Kooka Firmware and KookaSuite IDE maintain the Kookaberry V2 module pinout assignment while also supporting the Pico GPIO nomenclature.

Key considerations when using the Kooka Firmware on the Pico:

  • Kookaberry V2 has five onboard connectors (P1 to P5), with specific GPIO assignments:
    • P1: GP26
    • P2: GP27
    • P3A: GP12 and P3B: GP13
    • P4: GP28
    • P5: GP29
  • Two supported UARTs (UART-A and UART-B) with the following assignments:
    • UART-A TX: GP12, RX: GP13
    • UART-B TX: GP4, RX: GP5
    • Note: UART functionality can be assigned to other GPIO pins per Pico documentation
  • PWM, servo motors, and Neopixel displays can typically be assigned to any available GPIO pin.
  • Three analogue inputs available on GP26, GP27, and GP28, with an additional analogue input on GP29. The Kookaberry V2 Series modules expose GP29 on connector P5.
  • Three analogue inputs available on GP26, GP27, and GP28, with an additional analogue input on GP29. The Kookaberry V2 Series modules expose GP29 on connector P5.
  • I2C functionality can be assigned to any two GPIO pins, with P3 typically assigned in the Kooka Firmware.
  • SPI functionality can be assigned to GPIO pins, usually involving four pins.
  • Software RESET is assigned to GP6, allowing firmware reset without a Power Up Reset (PUR). A reset button on Kookaberry activates this function.
  • The Green LED on Pico (GP25) indicates data transmission over the USB port in the Kooka Firmware.
  • Download the KookaSuite IDE or KookaBlockly from THIS PAGE

Using the Pico with Kooka Firmware and KookaSuite Editors

The Pico board fitted with pin headers may be used in conjunction with prototyping boards, the Kooka Firmware and KookaSuite.

The Pico boards may also be used in conjunction with the Quokka Pico Break Out Modules which expose the available GPIO pins plus give access to the Kookaberry V2 assigned connectors P1 through P5

The JST PH Connector P3 (GPIO pins GP12 and GP13) is also exposed as a 4 pin JST SM04B connector.

  • Raspberry Pi is a trade mark of Raspberry Pi Ltd, UK
  • Pico is a microprocessor module manufactured by Raspberry Pi Ltd, UK
  • Blockly is a library from Google for building beginner-friendly block-based programming languages.
  • Kookaberry and Kooka are trademarks of Kookaberry Pty Ltd, Australia
  • The Kooka Firmware release and KookaSuite have been written by Damien George (George Robotics Pty Ltd –
  • MicroPython) in collaboration with Kookaberry Pty Ltd and the AustSTEM Foundation Ltd