C
Renesas RA6M3G FSP configuration
To get Qt Quick Ultralite working on RA6M3G, the FSP needs quite extensive configuration. Use the FSP editor in e2 studio to add the following FSP stacks and threads:
To know more about FSP Configuration tool, refer Configuring a Project and Adding Threads and Drivers section from RA FSP documentation.
Default FSP Configuration in Renesas e2 studio
Note: Use the default value for the property if not specified in the table.
BSP
Property | Value |
---|---|
RA Common > Main stack size (bytes) | 32768 |
RA Common > Heap size (bytes) | 102400 |
Notes:
- The values listed earlier are relevant for initial testing only, as the stack and heap sizes are application-specific.
- On default platform adaptation, these values do not have any effect as custom implementation allows the stack region to overlap with the heap region.
- Use the
startup.c
andsystem.c
files from the e2 Studio project to set the stack and heap size. You can find these system files in thera/fsp/src/bsp/cmsis/Device/RENESAS/Source
directory. - Use the
script/fsp.ld
linker script generated by e2 Studio as a reference to set stack and heap regions properly.
Stacks
Add the following stacks and configure them:
Analog > ADC (r_adc
)
Property | Value |
---|---|
Module > General > Name | g_adc0 |
Module > Input > Channel Scan Mask > Channel 2 | Selected |
Pins > AN02 | P002 |
Connectivity > I2C Master (r_iic_master
)
Property | Value |
---|---|
Module > Name | g_i2c_touch |
Module > Channel | 2 |
Module > Rate | Fast-mode |
Module > Rise Time (ns) | 120 |
Module > Fall Time (ns) | 120 |
Module > Duty Cycle (%) | 50 |
Module > Slave Address | 0x38 |
Module > Address Mode | 7-bit |
Module > Timeout Mode | Short Mode |
Module > Callback | touch_i2c_callback |
Module > Interrupt Priority Level | Priority 6 |
Pins > SDA | P511 |
Pins > SCL | P512 |
Connectivity > UART (r_sci_uart
)
Property | Value |
---|---|
Module > General > Name | g_uart0 |
Module > General > Channel | 0 |
Module > General > Data Bits | 8bits |
Module > General > Parity | None |
Module > General > Stop Bits | 1bit |
Module > Interrupts > Callback | user_uart_callback |
Pins > TXD_MOSI | P411 |
Pins > RXD_MISO | P410 |
Note: Set the Operation Mode to Asynchronous UART while assigning the pins for the UART. Additionally, either disable SPI0 or assign different pins to use the P410 and P411 pins for UART.
Graphics > D/AVE 2D Port Interface (r_drw
)
Property | Value |
---|---|
Common > Allow Indirect Mode | Enabled |
Common > Memory Allocation | Custom |
Module > D2 Device Handle Name | d2_handle0 |
Module > DRW Interrupt Priority | Priority 2 |
Graphics > Graphics LCD (r_glcdc
)
Property | Value |
---|---|
Module > General > Name | g_display0 |
Module > Interrupts > Callback Function | glcdc_callback |
Module > Interrupts > Line Detect Interrupt Priority | Priority 2 |
Module > Input > Graphics Layer 1 > General > Horizontal size | 480 |
Module > Input > Graphics Layer 1 > General > Vertical size | 272 |
Module > Input > Graphics Layer 1 > Framebuffer > Number of framebuffers | 1 |
Module > Input > Graphics Layer 1 > Framebuffer > Section for framebuffer allocation | .bss |
Module > Output > Timing > Horizontal total cycles | 525 |
Module > Output > Timing > Horizontal active video cycles | 480 |
Module > Output > Timing > Horizontal back porch cycles | 40 |
Module > Output > Timing > Horizontal sync signal cycles | 1 |
Module > Output > Timing > Horizontal sync signal polarity | Low active |
Module > Output > Timing > Vertical total lines | 316 |
Module > Output > Timing > Vertical active video lines | 272 |
Module > Output > Timing > Vertical back porch lines | 8 |
Module > Output > Timing > Vertical sync signal cycles | 1 |
Module > Output > Timing > Vertical sync signal polarity | Low active |
Module > Output > Timing > Data Enable Signal Polarity | High active |
Module > Output > Timing > Sync edge | Rising edge |
Module > Output > Format > Color format | 16bits RGB565 |
Module > TCON > Hsync pin select | LCD_TCON0 |
Module > TCON > Vsync pin select | LCD_TCON1 |
Module > TCON > Panel clock division ratio | 1/32 |
Note: If you need double buffering, change Number of framebuffers to 2
.
Input > External IRQ (r_icu
)
Property | Value |
---|---|
Module > Name | g_S1_irq0 |
Module > Channel | 13 |
Module > Trigger | Falling |
Module > Digital Filtering | Enabled |
Module > Digital Filtering Sample Clock | PCLK / 64 |
Module > Callback | s1_irq_callback |
Module > Pin Interrupt Priority | Priority 12 |
Pins > IRQ13 | P009 |
Input > External IRQ (r_icu
)
Property | Value |
---|---|
Module > Name | g_touch_irq |
Module > Channel | 0 |
Module > Trigger | Falling |
Module > Digital Filtering | Enabled |
Module > Digital Filtering Sample Clock | PCLK / 64 |
Module > Callback | touch_irq_cb |
Module > Pin Interrupt Priority | Priority 5 |
Pins > IRQ00 | P206 |
Note: Ensure that P206 is IRQ mode and its Pull up property is input pull-up.
Storage > QSPI (r_qspi
)
Property | Value |
---|---|
Module > General > Name | g_qspi0 |
Module > General > Bus Timing > Minimum QSSL Deselect Cycles | 8 QSPCLK |
Timers > Timer, General PWM (r_gpt
)
Property | Value |
---|---|
Common > Pin Output Support | Enabled |
Module > General > Name | g_timer_PWM |
Module > General > Channel | 7 |
Module > General > Mode | Saw-wave PWM |
Module > General > Period | 10 |
Module > General > Period Unit | Milliseconds |
Module > Output > Duty Cycle Percent | 75 |
Module > Output > GTIOCA Output Enabled | True |
Module > Output > GTIOCA Stop Level | Pin Level High |
Pins > GTIOCA | P603 |
Note: When setting the GTIOCA pin, ensure that Operation Mode of the GPT Timer is GTIOCA or GTIOCB, and pin P603 is Peripheral mode.
Add the S1 IRQ Driver r_icu
:
Property | Value |
---|---|
Module > Name | g_S1_irq |
Module > Channel | 13 |
Module > Trigger | Falling |
Module > Digital Filtering | Enabled |
Module > Digital Filtering Sample Clock | PCLK / 64 |
Module > Callback | s1_irq_callback |
Module > Pin Interrupt Priority | Priority 12 |
Pins > IRQ13 | P009 |
FSP for FreeRTOS
Now that you have added the generic FSP configuration, add the necessary FreeRTOS-specific configuration for the project. For the LED indicator application, using single heap for everything should be enough.
Create a new thread in the FSP configuration tool
Set the following Common properties for the thread:
Property | Value |
---|---|
Memory Allocation > Support Static Allocation | Enabled |
Memory Allocation > Support Dynamic Allocation | Enabled |
Memory Allocation > Total Heap Size | 102400 |
Memory Allocation > Application Allocated Heap | Enabled |
Hooks > Use Tick Hook | Enabled |
Optional Functions > uxTaskGetStackHighWatermark() Function | Enabled |
Set the following Thread properties:
Property | Value |
---|---|
Symbol | qul_thread |
Name | QulThread |
Stack Size (Bytes) | 32768 |
Priority | 4 |
Thread Context | NULL |
Memory Allocation | Dynamic |
Allocate Secure Context | Enable |
Add FreeRTOS Heap 4 stack to HAL/Common
Create another thread with the following Thread properties:
Property | Value |
---|---|
Symbol | app_thread |
Name | AppThread |
Stack Size (Bytes) | 1024 |
Priority | 4 |
Thread Context | NULL |
Memory Allocation | Dynamic |
Allocate Secure Context | Enable |
Create a new queue and set the following properties for it:
Property | Value |
---|---|
Symbol | g_app_queue |
Item Size (Bytes) | 1 |
Queue Length (Items) | 20 |
Memory Allocation | Dynamic |
Now, switch to the BSP tab in the FSP editor and click Generate project content.
Available under certain Qt licenses.
Find out more.