Hi @seanwu
Regarding speed, you can refer to the MCXN236 data sheet chapter 4.6.2.

After you set #define TRANSFER_BAUDRATE to 20000000.
You also need to two factors:
1. Peripheral Clock Configuration: The SPI baud rate is derived from the peripheral clock. Ensure that the peripheral clock is set appropriately to achieve the desired SPI speed.
2. Baud Rate Divisor: The SPI baud rate is determined by dividing the peripheral clock by a specific divisor. Selecting the correct divisor is crucial for achieving the desired baud rate.
BR
Harry