RX Family Application Note Renesas FreeRTOS

Document preview
File info: application/pdf · 21 pages · 1.45MB

RX Family Application Note Renesas FreeRTOS

828

Full PDF Document

Loading PDF...
Download PDF

If the inline viewer fails, it will open the original document in compatibility mode automatically. You can also open the file directly.

Extracted Text


RX 
Renesas FreeRTOS

R01AN4307JJ0104 Rev.1.04
2020.08.31


FreeRTOS  Renesas FreeRTOS  


� RX72M Group � RX72N Group � RX72T Group � RX71M Group � RX66T Group � RX66N Group � RX65N, RX651 Group � RX64M Group � RX23W Group � RX231 Group � RX230 Group � RX130 Group


� RX  Firmware Integration Technology (R01AN1685)
� RX  CMT  Firmware. Integration Technology (R01AN1856) � Renesas e2 studio  (R20AN0451)


� FreeRTOS customization: https://www.freertos.org/a00110.html [1] � FreeRTOS Memory Management: https://www.freertos.org/a00111.html [2]

R01AN4307JJ0104 Rev.1.04 2020.08.31

1/18 

RX  

Renesas FreeRTOS

1.  ................................................................................................................................................... 3 1.1 Renesas FreeRTOS ....................................................................................................... 3 1.2 Renesas FreeRTOS  RTOS  .......................................................... 3 1.2.1 CCRX  ......................................................................................................... 3 1.2.2 GCC ............................................................................................................ 4 1.3 BSP  .............................................................................................................. 5 1.3.1 BSP ...................................................................................................................................... 5 1.3.2 CMT  ........................................................................................................ 5

2.  ................................................................................................................................................... 6 2.1  ............................................................................................................................. 6 2.2  ............................................................................................................................. 6 2.3  ........................................................................................................... 6
3.  ........................................................................................................................................ 7 3.1  ...................................................................................................................... 7 3.1.1 heap_1.c ...................................................................................................................................... 7 3.1.2 heap_2.c ...................................................................................................................................... 7 3.1.3 heap_3.c ...................................................................................................................................... 7 3.1.4 heap_4.c ...................................................................................................................................... 7 3.2 ..................................................................................................................................... 8 3.3  .................................................................................................................... 11 3.4  ............................................................................................................. 13
4.  .................................................................................................................... 14 4.1 freertos_start.c, freertos_start.h ...................................................................................................... 15 4.1.1 RTOS  � void vApplicationSetupTimerInterrupt(void) .................... 15 4.1.2  � void vApplicationIdleHook(void)..................................................... 15 4.1.3  � void vApplicationTickHook(void) .................................................... 15 4.1.4 Malloc  � void vApplicationMallocFailedHook(void).................... 15 4.1.5 void Processing_Before_Start_Kernel(void).............................................................................. 15 4.2 void main_task(void *pvParameters) .............................................................................................. 15
5.  ................................................................................................................................................. 16 5.1 ................................................................................................................................... 16 5.2  .......................................................................................................................................... 17 5.2.1  configTOTAL_HEAP_SIZE_N  .................................................................... 17 5.2.2  e2studio ................................................................ 17

R01AN4307JJ0104 Rev.1.04 2020.08.31

2 / 18 

RX 

Renesas FreeRTOS

1. 

1.1 Renesas FreeRTOS 
Renesas FreeRTOS FreeRTOS  RX 

1.2 Renesas FreeRTOS  RTOS 
1.2.1 CCRX 
RTOS  e2studio Renesas FreeRTOS   FreeRTOS   FreeRTOS 
 RTOS 

Select "FreeRTOS (kernel only)" Select one of the versions Click this to check Renesas web for other version

R01AN4307JJ0104 Rev.1.04 2020.08.31

3 / 18 

RX 

Renesas FreeRTOS

1.2.2 GCC 
CCRX  GCC  Renesas FreeRTOS 
GCC 

Select "FreeRTOS (kernel only)" Select one of the versions
Click this to check Renesas web for other version

R01AN4307JJ0104 Rev.1.04 2020.08.31

4 / 18 

RX  1.3 BSP 

Renesas FreeRTOS

1.3.1 BSP 
 1.3  BSP 
 BSP_CFG_RTOS_USED 1
 BSP_CFG_RTOS_SYSTEM_TIMER 0 ( CMT  0 )
CMT  0  RTOS  e2studio  CMT  
1.3.2 CMT 
Renesas FreeRTOS  CMT   CMT   CMT  RTOS  CMT FIT CMT FIT   RTOS v3.30 

R01AN4307JJ0104 Rev.1.04 2020.08.31

5 / 18 

RX 
2. 
 FIT 

Renesas FreeRTOS

2.1 
 MCU   CMT

2.2 
 Renesas FreeRTOS  FIT   Renesas  (r_bsp)

2.3 
5.1  

R01AN4307JJ0104 Rev.1.04 2020.08.31

6 / 18 

RX 
3. 
3.1 

Renesas FreeRTOS

3.1.1 heap_1.c
 heap_1.c   ()   
[2] 

3.1.2 heap_2.c
 1   heap_4.c  FreeRTOSConfig.h  configTOTAL_HEAP_SIZE  FreeRTOSConfig.h  configAPPLICATION_ALLOCATED_HEAP  
[2] 
3.1.3 heap_3.c
C  malloc()  free()   malloc()  free() 
[2] 
3.1.4 heap_4.c
 2   () FreeRTOSConfig.h  configTOTAL_HEAP_SIZE  FreeRTOSConfig.h  configAPPLICATION_ALLOCATED_HEAP  
[2] 

R01AN4307JJ0104 Rev.1.04 2020.08.31

7 / 18 

RX 

Renesas FreeRTOS

3.2 
Renesas FreeRTOS FreeRTOSConfig.h  Renesas FreeRTOS  FreeRTOSConfig.h FreeRTOSConfig.h  RTOS  RTOS  RTOS  
 FreeRTOSConfig.h  BSP  RTOS  

R01AN4307JJ0104 Rev.1.04 2020.08.31

8 / 18 

RX 

Renesas FreeRTOS

FreeRTOSConfig.h 

configUSE_PREEMPTION configUSE_IDLE_HOOK configUSE_TICK_HOOK
configCPU_CLOCK_HZ

[1]  [1]  [1]  MCU  Hz 
 BSP  mcu_info.h  BSP_ICLK_HZ 

configPERIPHERAL_CLOCK_HZ

CMT  RX  PCLKB  mcu_info.h  BSP_PCLKB_HZ 

RTOS  

configTICK_RATE_HZ

 

configMINIMAL_STACK_SIZE

RTOS  CPU   1,000  [1] 

configTOTAL_HEAP_SIZE_N configMAX_TASK_NAME_LEN configUSE_TRACE_FACILITY configUSE_16_BIT_TICKS configIDLE_SHOULD_YIELD configUSE_CO_ROUTINES configUSE_MUTEXES configGENERATE_RUN_TIME_STATS configCHECK_FOR_STACK_OVERFLOW configUSE_RECURSIVE_MUTEXES configQUEUE_REGISTRY_SIZE configUSE_MALLOC_FAILED_HOOK configUSE_APPLICATION_TASK_TAG configUSE_QUEUE_SETS configUSE_COUNTING_SEMAPHORES configMAX_PRIORITIES configMAX_CO_ROUTINE_PRIORITIES configUSE_TIMERS configTIMER_TASK_PRIORITY configTIMER_QUEUE_LENGTH configTIMER_TASK_STACK_DEPTH configKERNEL_INTERRUPT_PRIORITY configMAX_SYSCALL_INTERRUPT_PRIORITY

3.3  [1]  [1]  [1]  [1]  [1]  [1]  [1]  [1]  [1]  [1]  [1]  [1]  [1]  [1]  [1]  [1]  [1]  [1]  [1]  [1]  [1]  [1] 

CMT  



configTICK_VECTOR
configUSE_TASK_NOTIFICATIONS configRECORD_STACK_HIGH_ADDRESS

_CMT0_CMI0: CMT0  _CMT1_CMI1: CMT1  _CMT2_CMI2: CMT2  _CMT3_CMI3: CMT3  [1]  [1] 

R01AN4307JJ0104 Rev.1.04 2020.08.31

9 / 18 

RX 

configNUM_THREAD_LOCAL_STORAGE_POINTE RS configSUPPORT_DYNAMIC_ALLOCATION
configSUPPORT_STATIC_ALLOCATION

[1] 
[1]  [1] 

Renesas FreeRTOS

R01AN4307JJ0104 Rev.1.04 2020.08.31

10 / 18 

RX 

Renesas FreeRTOS

3.3 
 FreeRTOS_Object  Heap Estimation                               (configTOTAL_HEAP_SIZE)       FreeRTOS  FreeRTOS  Heap Estimation  

 Heap Estimation 

R01AN4307JJ0104 Rev.1.04 2020.08.31

11 / 18 

RX 

Renesas FreeRTOS

FreeRTOS_Kernal "The configTOTAL_HEAP_SIZE_N"  configTOTAL_HEAP_SIZE_N*1024 Byte   Heap Estimation  KByte 

R01AN4307JJ0104 Rev.1.04 2020.08.31

12 / 18 

RX 

Renesas FreeRTOS

3.4 
 FreeRTOS_Object FreeRTOS Object  

   
 freerots_start.c 

"Total Amount Heap Usage" 
 e2studio  e2studio >>> RTOS FreeRTOS  4.2.4 Heap 

R01AN4307JJ0104 Rev.1.04 2020.08.31

13 / 18 

RX 

Renesas FreeRTOS

4. 
Renesas FreeRTOS  BSP  FreeRTOS 

R01AN4307JJ0104 Rev.1.04 2020.08.31

14 / 18 

RX 

Renesas FreeRTOS

4.1 freertos_start.c, freertos_start.h
RTOS  CMT  

4.1.1 RTOS  � void vApplicationSetupTimerInterrupt(void)
RTOS  CMT  (#define BSP_CFG_RTOS_SYSTEM_TIMER)  

4.1.2  � void vApplicationIdleHook(void)
RTOS   1    CPU    
FreeRTOSConfig.h  configUSE_IDLE_HOOK  1  

4.1.3  � void vApplicationTickHook(void)
  
FreeRTOSConfig.h  configUSE_TICK_HOOK  1  

4.1.4 Malloc  � void vApplicationMallocFailedHook(void)
heap_1.cheap_2.cheap_3.cheap_4.cheap_5.c  malloc() pvPortMalloc()  NULL  
malloc()  API  pvPortMalloc() 
malloc FreeRTOSConfig.h  configUSE_MALLOC_FAILED_HOOK  1 
4.1.5 void Processing_Before_Start_Kernel(void)
main_task() FreeRTOS   () 

4.2 void main_task(void *pvParameters)
Processing_Before_Start_Kernel()  

R01AN4307JJ0104 Rev.1.04 2020.08.31

15 / 18 

RX 

Renesas FreeRTOS

5. 

5.1 
Renesas FreeRTOS 

 5.1   IDE C 
  


 e2 studio  7.8  C/C++ Compiler Package for RX Family V.3.02 
 -lang = c99 GCC for Renesas RX 4.8.4.201902 : 
 -std=gnu99 : 

-Os -WI,--no-gc-sections
GCCFIT 

Renesas FreeRTOS  10.0.03 Renesas Starter Kit+ for RX72N (product No.: RTK5572NNxSxxxxxBE) Target Board for RX23W (product No.: RTK5RX23W0CxxxxxBJ) Renesas Starter Kit+ for RX130 512KB (product No.: RTK5051308CxxxxxBR) Renesas Starter Kit+ for RX72M (product No.: RTK5572MNDCxxxxxBJ) Renesas Starter Kit+ for RX72T (product No.: RTK5572TKCCxxxxxSE) Renesas Starter Kit+ for RX71M (product No.: R0K50571MSxxxBE) Renesas Starter Kit+ for RX66T (product No.: RTK50566T0CxxxxxBE) Renesas Starter Kit+ for RX65N-2M (product No.: RTK50565N2SxxxxxBE) Renesas Starter Kit+ for RX64M (product No.: R0K50564MSxxxBE) Renesas Starter Kit+ for RX231 (product No.: R0K505231CxxxBE)

R01AN4307JJ0104 Rev.1.04 2020.08.31

16 / 18 

RX 

Renesas FreeRTOS

5.2 5.2.1


 configTOTAL_HEAP_SIZE_N 
- configTOTAL_HEAP_SIZE_N  KByte  4  Heap  4KB 

5.2.2

 e2studio 
e2studio V.7.8  e2stduio 2020-04  

R01AN4307JJ0104 Rev.1.04 2020.08.31

17 / 18 

RX 

  Web  http://www.renesas.com/
 http://www.renesas.com/contact/

Renesas FreeRTOS


R01AN4307JJ0104 Rev.1.04 2020.08.31

18 / 18 



Rev. 1.00 1.01
1.02
1.03

 2019.01.21 2019.10.08
2020.01.30 2020.04.30

1.04

2020.08.31

 -- -
-
-
-
P.5 P.16 P.17









RX130RX230RX231 RX66TRX72TRX72M



RX23W



RX72NRX66N config_TOTAL_HEAP_SIZE config_TOTAL_HEAP_SIZE_N 1.2 GCC  5.1   5.2.2 e2studio




 
1.  CMOS CMOS   CMOS  
2.  LSI   
3.    
4.  CMOS  LSI LSI  
5.     
6.  CMOS VILMax.  VIHMin.VILMax. VIHMin.
7.   
8.    


1.   
2.   
3.  4. 
 5. 
 OA AV   Harsh environment      6.     7.  Harsh environment     8.   RoHS   9.    10.  11.  12.   1.   
  2.  1 
(Rev.4.0-1 2017.11)


 135-0061  3-2-24 www.renesas.com

   


  www.renesas.com/contact/

� 2020 Renesas Electronics Corporation. All rights reserved.