Sitemap

Vision Board Series Tutorial | Button Interrupt Experiment

4 min readJul 24, 2025

Preparation

A computer running Windows 10 or 11It is recommended to have a USB Type-C cable ready.

Resources

The cloud drive contains commonly used development tools required for the Vision Board:Baidu Cloud Link:

https://pan.baidu.com/share/init?surl=_9UNZbchYImCzTTRpwsmFw&pwd=azsd

Notes:

Before starting development, make sure to install the three software programs highlighted in red!

Press enter or click to view image in full size

Installing RT-Thread Studio IDE

1. Visit the following website to download and install the RT-Thread Studio IDE:

https://www.rt-thread.org/download.html#download-rt-thread-studio

Press enter or click to view image in full size

Installing FSP Configuration Tool

1. Install the FSP tool from the Baidu Cloud drive.

Press enter or click to view image in full size

2. Follow the installation steps to complete the process.

Button Interrupt Experiment

1. Open RT-Thread Studio, then select NewRT-Thread Project.

Press enter or click to view image in full size

2. Select Create Project based on Vision Board development board, and choose BSP version 1.3.0.

Press enter or click to view image in full size

3. If prompted that the toolchain is not installed or tools need to be downloaded, click OK to download them (make sure your computer is connected to the internet).

Press enter or click to view image in full size

4. Next, proceed to compile the project.

The compilation is successful when the following screen appears:

Press enter or click to view image in full size

5. Click the Download button to flash the successfully compiled firmware to the development board.

Press enter or click to view image in full size

Experiment Observation: The blue LED on the front of the development board will blink every 500ms.

6. Next, let’s open the FSP configuration for this project.

7. First, ensure that the RASC5.1.0 software from the resource package is installed. Then, return to Studio, double-click RA Smart Configurator, and follow the prompts to select the installation directory.

Press enter or click to view image in full size

8. Select the sc_v2023–10_fsp_v5.1.0 directory, and the FSP configuration software will automatically open.

Press enter or click to view image in full size

9. Next, let’s configure the button as an external interrupt pin. First, open the schematic diagram of the Vision Board.

Press enter or click to view image in full size

10. Open the second page of the PDF and locate the section for the user button.

Press enter or click to view image in full size

Analysis: When the button is pressed, it pulls the pin low, so the interrupt trigger mode is falling edge trigger.

11. Locate the pin number for KEY0: P907.

Press enter or click to view image in full size

12. Next, open FSP. You will find that the P907 pin corresponds to Interrupt Channel 10.

Press enter or click to view image in full size

13. Then, enable IRQ10 and bind it to the P907 pin.

Press enter or click to view image in full size

14. Next, return to the Stack interface, select New StackInputExternal IRQ.

Press enter or click to view image in full size

15. Based on the analysis above, configure Interrupt Channel 10 as shown in the following image:

Press enter or click to view image in full size

16. Finally, generate the low-level driver code.

Press enter or click to view image in full size

17. Next, return to the RT-Thread Studio project, and open hal_entry.c.

18. Replace the content inside hal_entry.c with the following code:

#include <rtthread.h>
#include <rtdevice.h>
#include "hal_data.h"

#define IRQ_TEST_PIN "p907"

void irq_callback_test(void *args)
{
rt_kprintf("\n IRQ10 triggered \n");
}

void hal_entry(void)
{
/* init */
rt_uint32_t pin = rt_pin_get(IRQ_TEST_PIN);
rt_kprintf("\n pin number : 0x%04X \n", pin);
rt_err_t err = rt_pin_attach_irq(pin, PIN_IRQ_MODE_FALLING, irq_callback_test, RT_NULL);
if(RT_EOK != err)
{
rt_kprintf("\n attach irq failed. \n");
}
err = rt_pin_irq_enable(pin, PIN_IRQ_ENABLE);
if(RT_EOK != err)
{
rt_kprintf("\n enable irq failed. \n");
}
}

19. After compiling and flashing the firmware to the development board, open the serial terminal. When we press the USER BOOT button on the development board, the following print information will appear:

--

--

RT-Thread IoT OS
RT-Thread IoT OS

Written by RT-Thread IoT OS

An Open-Source Community-Powered Real-Time Operating System (RTOS) Project! Let’s develop, DIY, create, share, and explore this new IoT World together!