Depending on which transport is used for micro-ROS specific configurations, the following should be done.
-
Copy the following files to the source directory:
extra_sources/microros_transports/usb_transport.cextra_sources/microros_transports/usb_descriptor.c
-
Double click on the
configuration.xmlfile of your project and go to theStackstab. -
Select
New Stack -> USB PCDC driver on r_usb_pcdc. -
Go to
Clockstab and configureUCLKclock to match 48MHz (Match the values on the highlighted boxes): -
Save the modifications by clicking on
Generate Project Content.
The configuration of this transports is board dependant:
EK-RA6M5
-
Copy the following files to the source directory:
extra_sources/microros_transports/uart_transport.c
-
Double click on the
configuration.xmlfile of your project and go to theStackstab. -
Select
New Stack -> r_src_uart. -
Optional: in order to set P411 and P410 as Tx/Rx first disable SPI1
-
Go to the component properties and configure the Tx/Rx pinout:
-
Save the modifications clicking on
Generate Project Content.
MCK-RA6T2
-
Copy the following files to the source directory:
extra_sources/microros_transports/uart_transport.c
-
Double click on the
configuration.xmlfile of your project and go to theStackstab. -
Select
New Stack -> r_src_b_uart. -
Go to
Clockstab and enableSCISPICLKclock.Example clock configuration:
-
Go to the Pins tab and configure the SCI port 0 and its pinout:
Optional: in order to set PA09 and PA10 as Tx/Rx first disable the timers GPT8 and GPT9
-
Save the modifications clicking on
Generate Project Content.
-
Copy the following files to the source directory:
extra_sources/microros_transports/udp_transport_freeRTOS.c
-
Double click on the
configuration.xmlfile of your project and go to theStackstab. -
Select
New Stack -> FreeRTOS + TCP. -
Configure the properties of the
FreeRTOS + TCP component:-
Common -> vApplicationIPNetworkEventHooktoDisable. -
Common -> DHCP Register HostnametoDisable. -
Optional: Enable DHCP
Common -> Use DHCPtoEnable.Note: If DHCP is disabled, the board network parameters can be configured on the transport source file
udp_transport_freeRTOS.c -
Optional: Increase number of buffers avaliable to the IP stack on
Common -> Total number of avaliable network buffers.
-
-
Increase number of Ethernet Tx buffers on
g_ether0 component -> Module g_ether0 Ethernet Driver on r_ether -> Buffers -> Number of RX bufferto 4: -
Save the modifications by clicking on
Generate Project Content. -
Configure micro-ROS agent IP and port passing a freeRTOS
freertos_sockaddrstruct to thermw_uros_set_custom_transportfunction:struct freertos_sockaddr remote_addr; remote_addr.sin_family = FREERTOS_AF_INET; remote_addr.sin_port = FreeRTOS_htons(8888); remote_addr.sin_addr = FreeRTOS_inet_addr("192.168.1.185"); rmw_uros_set_custom_transport( false, (void *) &remote_addr, renesas_e2_transport_open, renesas_e2_transport_close, renesas_e2_transport_write, renesas_e2_transport_read);
-
Copy the following files to the source directory:
extra_sources/microros_transports/udp_transport_threadX.c
-
Double click on the
configuration.xmlfile of your project and go to theStackstab. -
Select
New Stack -> Azure RTOS NetX Duo DHCP IPv4 Client. -
Click on Add NetX Duo Network Driver and select
New -> NetX Duo Ethernet Driver (rm_netxduo_ether): -
Click on Add NetX Duo Packet Pool and select
Use -> g_packet_pool0 Azure RTOS NetX Duo Packet Pool Instance: -
Optional: Increase number of buffers avaliable to the IP stack on
g_packet_pool0properties onModule g_packet_pool0 Azure RTOS NetX Duo Packet Pool Instance -> Number of Packets in Pool. -
Save the modifications by clicking on
Generate Project Content. -
Configure micro-ROS agent IP and port passing a
custom_transport_argsstruct to thermw_uros_set_custom_transportfunction:custom_transport_args remote_addr = { .agent_ip_address=IP_ADDRESS(192,168,1,185), .agent_port=8888 }; rmw_uros_set_custom_transport( false, (void *) &remote_addr, renesas_e2_transport_open, renesas_e2_transport_close, renesas_e2_transport_write, renesas_e2_transport_read);
This transport supports Renesas Wi-Fi-Pmod-Expansion-Board based on Silex SX-ULPGN module.
Support for other wifi modules can be added to the FSP as explained on chapter 4. Adding Support for New Wi-Fi module of this document:
Getting Started with the Wi-Fi Modules on FSP
Note: This configuration is valid for the connector PMOD1 (J26)
-
Copy the following files to the source directory:
extra_sources/microros_transports/wifi_transport_freeRTOS.c
-
Double click on the
configuration.xmlfile of your project and go to theComponentstab. -
Enable the following components:
-
Go to the
Stackstab and add aAWS Silex WiFi Sockets Wrappermodule. -
Remove the
AWS Cellular/WiFi MbedTLS Biosubmodule of the created component:Right click -> Delete.
-
Enable
Common -> General -> Use Mutexeson the micro-ROS thread properties. -
Configure the module reset pinout on the
rm_wifi_onchip_silexmodule properties:- Set
Common -> Module Reset Portto 3. - Set
Common -> Module Reset Pinto 11.
- Set
-
Configure the properties of the PMOD connection under the UART component properties (
g_uart0 UART (r_sci_uart))-
Enter Enable
FIFO support,DTC supportandFlow control supportoncommonproperties -
Add
DTC driversfor Transmission and Reception:
-
Select the SCI port 9 on
Module g_uart0 UART (r_sci_uart) -> General -> Channel. -
Go to the Pins tab and configure the SCI port and its pinout:
Optional: in order to set P203 and P202 as Tx/Rx first disable SPI0
-
Optional: To increase data throughput, increase the baud rate on
Module g_uart0 UART (r_sci_uart) -> Baud -> Baud Rate. Values up to460800 baudshas been tested
-
-
Save the modifications by clicking on
Generate Project Content. -
Configure the transport connection passing a
custom_transport_argsstruct to thermw_uros_set_custom_transportfunction:-
Configure the wifi network with a
WIFINetworkParams_tobject:// Configure wifi network WIFINetworkParams_t network_conf = { .ucChannel = 0, .ucSSID = "[YOUR_SSID_HERE]", .xPassword.xWPA.cPassphrase = "[YOUR_PSK_HERE]", .xSecurity = eWiFiSecurityWPA2, };
Notes: - Currently only the following security protocols are supported:
eWiFiSecurityOpen,eWiFiSecurityWPAandeWiFiSecurityWPA2- The network ssid and password length is limited to 31 characters -
Configure agent IP and port on a
custom_transport_argsobject and pass it down to thermw_uros_set_custom_transportmethod:// Add configuration to transport args custom_transport_args wifi_args = { .network_conf = &network_conf, .agent_ip = "192.168.1.93", .agent_port = 8888 }; rmw_uros_set_custom_transport( false, (void *) &wifi_args, renesas_e2_transport_open, renesas_e2_transport_close, renesas_e2_transport_write, renesas_e2_transport_read );
-
-
Copy the following files to the source directory:
extra_sources/microros_transports/canfd_transport.c
-
Double click on the
configuration.xmlfile of your project and go to theStackstab. -
Select
New Stack -> r_canfd. -
Go to
Clockstab: -
Configure CAN reception:
Common -> Reception -> Message Buffers -> Number of Buffersto0.Common -> Reception -> FIFOs -> FIFO 0 -> EnabletoEnabledCommon -> Reception -> FIFOs -> FIFO 0 -> Interrupt ModetoEvery Frame.Common -> Reception -> FIFOs -> FIFO 0 -> Payload Sizeto64 bytes.
-
Configure CAN interrupts:
- Enable
Module g_canfd0 CANFD Driver on r_canfd -> Transmit Interrupts -> TXMB 0. - Set
Module g_canfd0 CANFD Driver on r_canfd -> Interrupts -> Channel Interrupt Priority LeveltoPriority 3. - Enable all interrupts on
Module g_canfd0 CANFD Driver on r_canfd -> Channel Error Interrupts.
- Enable
-
Configure CAN component:
-
Configure your CAN FD Bitrate:
-
Modify micro-ROS library build options:
-
Create a file named
app_colcon.metaon your project main directory. -
Add the following configuration to the file:
{ "names": { "rmw_microxrcedds": { "cmake-args": [ "-DRMW_UXRCE_STREAM_HISTORY=8" ] }, "microxrcedds_client": { "cmake-args": [ "-DUCLIENT_CUSTOM_TRANSPORT_MTU=63" ] }, } } -
Optional: Increase the number of stream buffers to match your message requirements with
RMW_UXRCE_STREAM_HISTORY.This parameter will control the maximum payload of a publish message:
RMW_UXRCE_STREAM_HISTORY * UCLIENT_CUSTOM_TRANSPORT_MTU (bytes) -
To rebuild the micro-ROS library, clean and rebuild your project.
-
-
Set CAN transport configuration on the
canfd_transport.cfile: -
Save the modifications clicking on
Generate Project Content.














