1.. zephyr:board:: frdm_mcxc242 2 3Overview 4******** 5 6FRDM-MCXC242 is a compact and scalable development board for rapid 7prototyping of MCX C242 MCU. It offers industry standard headers 8for easy access to the MCU’s I/Os, integrated open-standard serial 9interfaces and on-board MCU-Link debugger. 10The MCXC is a general purpose ultra-low-power MCU family, 11providing additional memory, communications and analog peripheral. 12 13Hardware 14******** 15 16- MCXC242VLH Arm Cortex-M0+ microcontroller running at 48 MHz 17- 64LQFP package 18- 64KB flash 19- 16KB SRAM 20- USB FS 2.0 21- 2x low-power UART, 1x UART, 2x I2C, 2x SPI 22- FXLS8974CF accelerometer 23- NTC temperature sensor 24- RGB user LED 25- On-board MCU-Link debugger with CMSIS-DAP 26- Arduino Header, mikroBUS, Pmod 27 28For more information about the MCXC242 SoC and FRDM-MCXC242 board, see 29these references: 30 31- `MCX C14x/24x/44x Website`_ 32- `MCX C24x Datasheet`_ 33- `MCX C24x Reference Manual`_ 34- `FRDM-MCXC242 Website`_ 35- `FRDM-MCXC242 User Manual`_ 36- `FRDM-MCXC242 Design Files`_ 37 38Supported Features 39================== 40 41The ``frdm_mcxc242`` board target supports the following hardware features: 42 43+-----------+------------+-------------------------------------+ 44| Interface | Controller | Driver/Component | 45+===========+============+=====================================+ 46| NVIC | on-chip | nested vector interrupt controller | 47+-----------+------------+-------------------------------------+ 48| SYSTICK | on-chip | systick | 49+-----------+------------+-------------------------------------+ 50| PINMUX | on-chip | pinmux | 51+-----------+------------+-------------------------------------+ 52| GPIO | on-chip | gpio | 53+-----------+------------+-------------------------------------+ 54| UART | on-chip | serial port-polling | 55| | | serial port-interrupt | 56+-----------+------------+-------------------------------------+ 57| FLASH | on-chip | soc flash | 58+-----------+------------+-------------------------------------+ 59| I2C | on-chip | i2c | 60+-----------+------------+-------------------------------------+ 61| USB | on-chip | USB device | 62+-----------+------------+-------------------------------------+ 63| PWM | on-chip | pwm | 64+-----------+------------+-------------------------------------+ 65| ADC | on-chip | adc | 66+-----------+------------+-------------------------------------+ 67| LPTMR | on-chip | counter | 68+-----------+------------+-------------------------------------+ 69| PIT | on-chip | counter | 70+-----------+------------+-------------------------------------+ 71| RTC | on-chip | counter | 72+-----------+------------+-------------------------------------+ 73 74 75Targets available 76================== 77 78The default configuration can be found in 79:zephyr_file:`boards/nxp/frdm_mcxc242/frdm_mcxc242_defconfig` 80 81Other hardware features are not currently supported by the port. 82 83Connections and IOs 84=================== 85 86The MCXC242 SoC has five pairs of pinmux/gpio controllers (PORTA/GPIOA, 87PORTB/GPIOB, PORTC/GPIOC, PORTD/GPIOD, and PORTE/GPIOE) for the FRDM-MCXC242 board. 88 89+-------+-------------+---------------------------+ 90| Name | Function | Usage | 91+=======+=============+===========================+ 92| PTE16 | ADC | ADC0 channel 1 | 93+-------+-------------+---------------------------+ 94| PTB18 | GPIO | Red LED | 95+-------+-------------+---------------------------+ 96| PTB19 | GPIO | Green LED | 97+-------+-------------+---------------------------+ 98| PTA13 | GPIO | Blue LED | 99+-------+-------------+---------------------------+ 100| PTA1 | LPUART0_RX | UART Console | 101+-------+-------------+---------------------------+ 102| PTA2 | LPUART0_TX | UART Console | 103+-------+-------------+---------------------------+ 104| PTA20 | RESET | RESET Button SW1 | 105+-------+-------------+---------------------------+ 106| PTC1 | GPIO | User button SW2 | 107+-------+-------------+---------------------------+ 108| PTA4 | GPIO | User button SW3 | 109+-------+-------------+---------------------------+ 110| PTD6 | I2C1_SDA | I2C accelerometer | 111+-------+-------------+---------------------------+ 112| PTD7 | I2C1_SCL | I2C accelerometer | 113+-------+-------------+---------------------------+ 114 115System Clock 116============ 117 118The MCXC242 SoC is configured to use HIRC running at 48 MHz as a system clock source. 119 120Serial Port 121=========== 122 123The MCXC242 LPUART0 is used for the console. 124 125Programming and Debugging 126************************* 127 128Build and flash applications as usual (see :ref:`build_an_application` and 129:ref:`application_run` for more details). 130 131Configuring a Debug Probe 132========================= 133 134A debug probe is used for both flashing and debugging the board. This board is 135configured by default to use the MCU-Link CMSIS-DAP Onboard Debug Probe. 136 137Using LinkServer 138---------------- 139 140Linkserver is the default runner for this board, and supports the factory 141default MCU-Link firmware. Follow the instructions in 142:ref:`mcu-link-cmsis-onboard-debug-probe` to reprogram the default MCU-Link 143firmware. This only needs to be done if the default onboard debug circuit 144firmware was changed. To put the board in ``DFU mode`` to program the firmware, 145short jumper JP1. 146 147Using J-Link 148------------ 149 150There are two options. The onboard debug circuit can be updated with Segger 151J-Link firmware by following the instructions in 152:ref:`mcu-link-jlink-onboard-debug-probe`. 153To be able to program the firmware, you need to put the board in ``DFU mode`` 154by shortening the jumper JP1. 155The second option is to attach a :ref:`jlink-external-debug-probe` to the 15610-pin SWD connector (J10) of the board. Additionally, the jumper JP3 must 157be shortened. 158For both options use the ``-r jlink`` option with west to use the jlink runner. 159 160.. code-block:: console 161 162 west flash -r jlink 163 164Configuring a Console 165===================== 166 167Connect a USB cable from your PC to J9, and use the serial terminal of your choice 168(minicom, putty, etc.) with the following settings: 169 170- Speed: 115200 171- Data: 8 bits 172- Parity: None 173- Stop bits: 1 174 175Flashing 176======== 177 178Here is an example for the :zephyr:code-sample:`hello_world` application. 179 180.. zephyr-app-commands:: 181 :zephyr-app: samples/hello_world 182 :board: frdm_mcxc242 183 :goals: flash 184 185Open a serial terminal, reset the board (press the SW1 button), and you should 186see the following message in the terminal: 187 188.. code-block:: console 189 190 *** Booting Zephyr OS build v3.6.0-4475-gfa5bd8bb098e *** 191 Hello World! frdm_mcxc242/mcxc242 192 193Debugging 194========= 195 196Here is an example for the :zephyr:code-sample:`hello_world` application. 197 198.. zephyr-app-commands:: 199 :zephyr-app: samples/hello_world 200 :board: frdm_mcxc242 201 :goals: debug 202 203Open a serial terminal, step through the application in your debugger, and you 204should see the following message in the terminal: 205 206.. code-block:: console 207 208 *** Booting Zephyr OS build v3.6.0-4475-gfa5bd8bb098e *** 209 Hello World! frdm_mcxc242/mcxc242 210 211.. _MCX C14x/24x/44x Website: 212 https://www.nxp.com/products/processors-and-microcontrollers/arm-microcontrollers/general-purpose-mcus/mcx-arm-cortex-m/mcx-c-series-microcontrollers/mcx-c14x-24x-44x-mcus-with-arm-cortex-m0-plus-entry-level-mcus-with-usb-segment-lcd-and-classical-peripherals:MCX-C14x-24x-44x 213 214.. _MCX C24x Datasheet: 215 https://www.nxp.com/docs/en/data-sheet/MCXC24XP64M48SF2.pdf 216 217.. _MCX C24x Reference Manual: 218 https://www.nxp.com/webapp/Download?colCode=MCXC24XP64M48RM 219 220.. _FRDM-MCXC242 Website: 221 https://www.nxp.com/design/design-center/development-boards-and-designs/general-purpose-mcus/frdm-development-board-for-mcx-c242-mcus:FRDM-MCXC242 222 223.. _FRDM-MCXC242 User Manual: 224 https://www.nxp.com/webapp/Download?colCode=UM12119 225 226.. _FRDM-MCXC242 Design Files: 227 https://www.nxp.com/webapp/Download?colCode=FRDM-MCXC242-DESIGN-FILES 228