This post was last edited by Northern on 2026-1-28 16:15
1. Based on my learning pace, I plan to start with VS Code. It's quick and efficient. I'll download and launch VS Code first.
However, the rt-thread studio plugin was not found in the extensions list this time, indicating it's temporarily offline. You'll need to download an offline package or wait for an update.
Therefore, it's best to switch back to the traditional rt-thread studio, download and install it.
Fortunately, everything went smoothly, and the program started after I logged into my account.
The first step is complete.
2. To load the SDK, you first need to launch the SDK Manager.
I searched through them one by one, and found that I needed to install the development board's packages, a suitable compiler, and a downloader first. I finally found the download option for the Titan development board.
You need to download the latest pyocd first. This is the downloader, and only the latest version supports RA8P1, which is the chip on this development board.
Next, download the development package. You can use an SDK manager to download it directly, but since it requires access to GitHub, which is an unstable source, it's better to download the offline package first and install it. This includes the decompression and installation process, which will take a while.
The installation is now complete. However, you can see that it has been handled differently, labeled as an offline package.
3. Code initialization and compilation
This is a traditional skill, starting with light bulbs. Since installing the development kit, it's just a matter of clicking the mouse; selecting something causes many problems.
This is standard rt-thread code, with msh enabled.
#include <rtthread.h>
#include "hal_data.h"
#include <rtdevice.h>
#include <board.h>
#define DBG_TAG "led"
#define DBG_LVL DBG_LOG
#include <rtdbg.h>
/* 配置 LED 灯引脚 */
#define LED_PIN_R BSP_IO_PORT_00_PIN_13
#define LED_PIN_B BSP_IO_PORT_00_PIN_12
#define LED_PIN_G BSP_IO_PORT_06_PIN_13
/* 定义 LED 亮灭电平 */
#define LED_ON (0)
#define LED_OFF (1)
/* 定义 8 组 LED 闪灯表,其顺序为 R B G */
static const rt_uint8_t _blink_tab[][3] =
{
{LED_OFF, LED_OFF, LED_OFF},
{LED_ON, LED_OFF, LED_OFF},
{LED_OFF, LED_ON, LED_OFF},
{LED_OFF, LED_OFF, LED_ON},
{LED_ON, LED_OFF, LED_ON},
{LED_ON, LED_ON, LED_OFF},
{LED_OFF, LED_ON, LED_ON},
{LED_ON, LED_ON, LED_ON},
};
void hal_entry(void)
{
rt_kprintf("\nHello RT-Thread!\n");
rt_kprintf("==================================================\n");
rt_kprintf("This example project is an RGB flicker routine!\n");
rt_kprintf("==================================================\n");
unsigned int count = 0;
unsigned int group_num = sizeof(_blink_tab)/sizeof(_blink_tab[0]);
unsigned int group_current;
/* 设置 RGB 灯引脚为输出模式 */
rt_pin_mode(LED_PIN_R, PIN_MODE_OUTPUT);
rt_pin_mode(LED_PIN_G, PIN_MODE_OUTPUT);
rt_pin_mode(LED_PIN_B, PIN_MODE_OUTPUT);
rt_pin_write(LED_PIN_R, LED_OFF);
rt_pin_write(LED_PIN_G, LED_OFF);
rt_pin_write(LED_PIN_B, LED_OFF);
do
{
/* 获得组编号 */
group_current = count % group_num;
/* 控制 RGB 灯 */
rt_pin_write(LED_PIN_R, _blink_tab[group_current][0]);
rt_pin_write(LED_PIN_B, _blink_tab[group_current][1]);
rt_pin_write(LED_PIN_G, _blink_tab[group_current][2]);
/* 输出 LOG 信息 */
LOG_D("group: %d | red led [%-3.3s] | | blue led [%-3.3s] | | green led [%-3.3s]",
group_current,
_blink_tab[group_current][0] == LED_ON ? "ON" : "OFF",
_blink_tab[group_current][1] == LED_ON ? "ON" : "OFF",
_blink_tab[group_current][2] == LED_ON ? "ON" : "OFF");
count++;
/* 延时一段时间 */
rt_thread_mdelay(500);
}while(count > 0);
}
The overall code structure is as follows:
The compilation went smoothly. This indicates that the development environment is working well together.
However, the download failed completely.
The device was not found in Device Manager.
4. Next steps
This process allowed me to get started with the development board, but the debugger connection failed, and there's still a long way to go.
Overall, the rt-thread development environment runs quite smoothly. However, there are still some issues regarding the connection and use of the development board that require some getting used to.