MCUXpresso SDK Documentation

xrdc#

Overview#

The xrdc example shows how to control the memory and peripheral access policy using XRDC.

In this example, one peripheral and a memory region are set to unaccessible, then the hardfault occurs.

Running the demo#

The log below shows the output of the example in the terminal window. NOTE The access address might be different by platforms.

XRDC example start
Set the peripheral not accessible
Violent access at address: 0x40032000
The peripheral is accessible now
Set the memory not accessible
Violent access at address: 0x08000000
The memory is accessible now
XRDC example Success

Supported Boards#

EVK-MCIMX7ULP
Hardware requirements
  • Micro USB cable

  • MCIMX7ULP-EVK board

  • J-Link Debug Probe

  • 5V power supply

  • Personal Computer

Board settings

No special settings are required.

Please note this application can’t support running with Linux BSP!

Prepare the Demo

This should be run together with uboot.

  1. Build the project and generate the .bin file.

  2. Copy the .bin file to <sdk_dir>/tools/imgutil/evkmcimx7ulp folder and rename to sdk20-app.bin.

  3. In the folder <sdk_dir>/tools/imgutil/evkmcimx7ulp, run “mkimage.sh ram or mkimage.sh flash” (see readme in the <sdk_dir>/tools/imgutil )to create bootable image.

  4. Prepare an SD card with the prebuilt U-Boot image and copy the sdk20-app.img generated into the SD card. Then, insert the SD card to the target board. Make sure to use the default boot SD slot and check the dip switch configuration

  5. Open a serial terminal with the following settings to connect to Cortex-A:

    • 115200 baud rate

    • 8 data bits

    • No parity

    • One stop bit

    • No flow control

  6. Connect 5V power supply to the board, switch SW1 to power on the board.

  7. Hit any key to stop autoboot in the terminals, then enter to U-Boot command line mode. Then write the image and run it from QSPI Flash with the following commands:

    • sf probe

    • sf erase 0x0 0x20000

    • fatload mmc 0:1 0x62000000 sdk20-app.img

    • sf write 0x62000000 0x0 0x20000

  8. Open a serial terminal with the following settings to connect to Cortex-M:

    • 115200 baud rate

    • 8 data bits

    • No parity

    • One stop bit

    • No flow control

  9. Switch the SW1 to re-power the board.

  10. Hit any key to stop uboot autoboot in the Cortex-A terminals.

Running the demo

Please note the XRDC can’t access the MRGD register unless the related memory region clock has been enabled!

FRDM-K32L3A6
Hardware requirements
  • Mini/micro USB cable

  • FRDM-K32L3A6 board

  • Personal Computer

Board settings

No special settings are required.

Prepare the Demo
  1. Connect a USB cable between the host PC and the OpenSDA USB port on the target board.

  2. Open a serial terminal with the following settings:

    • 115200 baud rate

    • 8 data bits

    • No parity

    • One stop bit

    • No flow control

  3. Download the program to the target board.

  4. Either press the reset button on your board or launch the debugger in your IDE to begin running the demo.

FRDM-MCXE31B
Hardware requirements
  • Type-C USB cable

  • FRDM-MCXE31B board

  • Personal Computer

Board settings

No special settings are required.

Prepare the Demo
  1. Connect a type-c USB cable between the host PC and the MCU-Link USB port (J13) on the target board.

  2. Open a serial terminal with the following settings:

    • 115200 baud rate

    • 8 data bits

    • No parity

    • One stop bit

    • No flow control

  3. Download the program to the target board.

  4. Either press the reset button on your board or launch the debugger in your IDE to begin running the demo.

FRDM-MCXE32B
Hardware requirements
  • Type-C USB cable

  • FRDM-MCXE32B board

  • Personal Computer

Board settings

No special settings are required.

Prepare the Demo
  1. Connect a type-c USB cable between the host PC and the MCU-Link USB port (J13) on the target board.

  2. Open a serial terminal with the following settings:

    • 115200 baud rate

    • 8 data bits

    • No parity

    • One stop bit

    • No flow control

  3. Download the program to the target board.

  4. Either press the reset button on your board or launch the debugger in your IDE to begin running the demo.