The qn9080dk includes a MMA8652FC chip connected to the I2C0 bus, this
patch adds the driver for the in the default.
Note that the MMA8652FC device is powered from the LPC_VCC line, which
is different from the QN_VCC line that powers the QN9080 MCU. A voltage
level translator is included in the QN9080DK which is only enabled when
JP11 (labeled "G-Sensor I2C") is closed and the LPC debugger hardware
is powered, for example from the USB port.
The QN9080DK board can expose the I2C bus SDA and SCL in the pins
labeled D14 and D15 respectively in the J5 headers, and in the Pmod (J8)
connector in the pins 10 and 9 of the header respectively.
The bus has a 2K2 pull up resistor on each line when SB7 and SB8 (next
to the Pmod connector) are closed, which is the factory default.
If the same callback function is used for multiple interfaces
(`NETDEV_INDEX_ANY`), it is necessary to also provide the index of
the interface to hand out and address.
The QN908x CPU has several timer modules: one RTC (Real-Time Clock) that
can count from the 32kHz internal clock or 32.768 kHz external clock,
four CTIMER that use the APB clock and have four channels each and one
SCT timer with up to 10 channels running on the AHB clock.
This patch implements a timer driver for the CTIMER blocks only, which
is enough to make the xtimer module work. Future patches should improve
on this module to support using the RTC CNT2 32-bit free-running
counter unit and/or the SCT timer.
The QN908x has four FLEXCOMM interfaces that support a subset of UART,
SPI or I2C each one. This patch adds generic support for dealing with
the FLEXCOMM initialization and interrupts and adds a driver for
RX/TX support in UART.
With this patch is now possible to use a shell on the device over UART.
QN908X CPUs require the image to have a valid checksum. The checksum is
a simple addition of the first 7 uint32_t values stored in the 8th
position of the image header. This position is a reseved entry of the
Cortex-M Vector Table and its value depends on other fields that are
computed at link time. Performing this checksum at link time seems
hard to do, so instead this patch uses a python script to patch the
checksum from the ELF file. This redefines the value of FLASHFILE
to the new .elf file with the checksum fixed.
With this patch, OpenOCD can program and verify QN908X images since
now they have a valid checksum value.
- include serial.inc.mk is not needed as it's handled in the main Makefile.include
- the default serial ports are already defined in serial.inc.mk
- use PROGRAMMER to specify the default programmer (openocd) and don't include openocd.inc.mk
- FLASHFILE is already defined as ELFILE in openocd.inc.mk
The QN9080DK is the developer board reference from NXP for the QN908x
CPUs. The developer kit comes with two boards: a larger PCB with many
peripherals and a much smaller "USB dongle". This board adds initial
support for the larger "DK board". At the moment, with the minimal CPU
support this board only configures the GPIOs available in the board,
namely the RGB LED and the two user buttons.
Boards based on the qn908x CPU will share the same OpenOCD configuration
regarding the image offset and OpenOCD commands needed to flash the
image directly with "make flash".