Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob

Porting RT-Thread to ModusToolbox

Porting RT-Thread to ModusToolbox

LeoYan_css
Employee
Employee
5 questions asked 5 sign-ins First question asked

The background of this KBA is that some customers need to run RT-Thread OS on PSoC6 with ModusToolbox. They use ModusToolbox to develop PSoC6 application instead of RT-Thread Studio IDE. Currently RT-Thread has ported PSoC6 code into RT-Thread Studio IDE, but ModusToolbox does not support RT-Thread OS. Thus, we port RT-Thread code into ModusToolbox.

The software environment is ModusToolbox3.0. The RT-Thread source code is rt-thread-master from GitHub https://github.com/RT-Thread/rt-thread. The hardware is PSoC6 2M CY8CPROTO-062-4343W because customer uses CY8C624ABZI-S2D44.

Below is RT-Thread startup flow. The entry code is entry() in GCC.

 

leoyan_0-1690440941431.png

 

Figure 1  RT-Thread Startup Flow

 We need to modify startup_psoc6_02_cm4.S like Figure 2.

leoyan_1-1690440941438.png

Figure 2  PSoC6 Startup file

Also need to modify linkscript file linker.ld to add some section by RT-Thread define like Figure 3.

leoyan_2-1690440941446.pngFigure 3  PSoC6 Linkscript file

The RT-Thread source code folder in ModusToolbox is as below.

leoyan_3-1690440941448.png

 Figure 4  RT-Thread code folder in ModusToolbox3.0

The rtconfig.h should be modified to open peripheral driver of PSoC6 by Figure 5.

leoyan_4-1690440941456.png

Figure 5  rtconfig.h

Below is the FinSH shell start run after ModusToolbox project compiled and programmed.  

leoyan_5-1690440941460.png

Figure 6 FinSH shell

181 Views
Contributors