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

PropertyValue
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 and system.c files from the e2 Studio project to set the stack and heap size. You can find these system files in the ra/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)

PropertyValue
Module > General > Nameg_adc0
Module > Input > Channel Scan Mask > Channel 2Selected
Pins > AN02P002

Connectivity > I2C Master (r_iic_master)

PropertyValue
Module > Nameg_i2c_touch
Module > Channel2
Module > RateFast-mode
Module > Rise Time (ns)120
Module > Fall Time (ns)120
Module > Duty Cycle (%)50
Module > Slave Address0x38
Module > Address Mode7-bit
Module > Timeout ModeShort Mode
Module > Callbacktouch_i2c_callback
Module > Interrupt Priority LevelPriority 6
Pins > SDAP511
Pins > SCLP512

Connectivity > UART (r_sci_uart)

PropertyValue
Module > General > Nameg_uart0
Module > General > Channel0
Module > General > Data Bits8bits
Module > General > ParityNone
Module > General > Stop Bits1bit
Module > Interrupts > Callbackuser_uart_callback
Pins > TXD_MOSIP411
Pins > RXD_MISOP410

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)

PropertyValue
Common > Allow Indirect ModeEnabled
Common > Memory AllocationDefault
Module > D2 Device Handle Named2_handle0
Module > DRW Interrupt PriorityPriority 2

Graphics > Graphics LCD (r_glcdc)

PropertyValue
Module > General > Nameg_display0
Module > Interrupts > Callback Functionglcdc_callback
Module > Interrupts > Line Detect Interrupt PriorityPriority 2
Module > Input > Graphics Layer 1 > Framebuffer > Number of framebuffers1

Note: If you need double buffering, change Number of framebuffers to 2.

Input > External IRQ (r_icu)

PropertyValue
Module > Nameg_touch_irq
Module > Channel0
Module > TriggerFalling
Module > Digital FilteringEnabled
Module > Digital Filtering Sample ClockPCLK / 64
Module > Callbacktouch_irq_cb
Module > Pin Interrupt PriorityPriority 5
Pins > IRQ00P206

Note: Ensure that P206 is IRQ mode and its Pull up property is input pull-up.

Storage > QSPI (r_qspi)

PropertyValue
Module > General > Nameg_qspi0
Module > General > Bus Timing > Minimum QSSL Deselect Cycles8 QSPCLK

Timers > Timer, General PWM (r_gpt)

PropertyValue
Common > Pin Output SupportEnabled
Module > General > Nameg_timer_PWM
Module > General > Channel7
Module > General > ModePWM
Module > General > Period10
Module > General > Period UnitMilliseconds
Module > Output > Duty Cycle Percent75
Module > Output > GTIOCA Output EnabledTrue
Pins > GTIOCAP603

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:

PropertyValue
Module > Nameg_S1_irq
Module > Channel13
Module > TriggerFalling
Module > Digital FilteringEnabled
Module > Digital Filtering Sample ClockPCLK / 64
Module > Callbacks1_irq_callback
Module > Pin Interrupt PriorityPriority 12
Pins > IRQ13P009

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:

PropertyValue
Memory Allocation > Support Static AllocationEnabled
Memory Allocation > Support Dynamic AllocationEnabled
Memory Allocation > Total Heap Size102400
Memory Allocation > Application Allocated HeapEnabled
Hooks > Use Tick HookEnabled
Optional Functions > uxTaskGetStackHighWatermark() FunctionEnabled

Set the following Thread properties:

PropertyValue
Symbolqul_thread
NameQulThread
Stack Size (Bytes)32768
Priority4
Thread ContextNULL
Memory AllocationDynamic
Allocate Secure ContextEnable

Add FreeRTOS Heap 4 stack to HAL/Common

Create another thread with the following Thread properties:

PropertyValue
Symbolapp_thread
NameAppThread
Stack Size (Bytes)1024
Priority4
Thread ContextNULL
Memory AllocationDynamic
Allocate Secure ContextEnable

Create a new queue and set the following properties for it:

PropertyValue
Symbolg_app_queue
Item Size (Bytes)1
Queue Length (Items)20
Memory AllocationDynamic

Now, switch to the BSP tab in the FSP editor and click Generate project content.

Available under certain Qt licenses.
Find out more.