micro_ros_stm32cubemx_utils icon indicating copy to clipboard operation
micro_ros_stm32cubemx_utils copied to clipboard

rclc_support_init() Function doesnt work and give me an RCL_RET_ERROR back

Open 28marcel28 opened this issue 1 year ago • 9 comments

Hello Microros or ROS2 Community,

Im using Ubuntu 22.04 LTS on an Raspberry Pi 4.0 (Compute Module). Im using a STM32F767ZI with the STM32CubeIDE Version 1.7 with microros stack (micro_ros_stm32cubemx_utils). I can compile and flash the MCU with docker. It still works.

The problem is, that the rclc_support_init() function doesn`t initialize rcl and doesn´t create some support data structures. Cause They give me a RCL_RET_ERROR back.

Thats the reason i cant create my Publisher.

And so, the communication between both devices doesn´t work with the Agent and the XRCE-DDS-Client on stm32.

In the github Issues I found 3 times the same problem, but they have no solution.

Issue 1: https://github.com/micro-ROS/micro_ro...

Issue 2: https://github.com/micro-ROS/micro_ro...

Issue 3: https://github.com/micro-ROS/micro_ro...

Can anyone help me with this problem? Or get anyone a solution for this problem?

Thank you for your help,

Your Microros Developer Marcel.

28marcel28 avatar Aug 16 '23 09:08 28marcel28

Hello, which transport are you using?

pablogs9 avatar Aug 16 '23 09:08 pablogs9

I am utilizing USART3 in combination with DMA Transport. The configuration in my .ioc file is as follows: DMA Rx and Tx are both set to a very high priority. Rx is configured to operate in circular mode. Additionally, I have enabled the global interrupt for USART3 in the NVIC settings.

For the implementation of the MicroROS Stack in STM32CubeIDE, I am referring to this video: https://www.youtube.com/watch?v=bn-P3fxtTF4

However, I am encountering an issue with the rclc_support_init() function, as it fails to generate and triggers SOMETIMES the hardfault handler. If The Hardfault handler is not triggered the RCL_RET_ERROR will me send back. I did review your previously closed issue regarding a similar problem, but I do not seem to be experiencing the same issues that were identified in that case.

28marcel28 avatar Aug 16 '23 09:08 28marcel28

Could you check if the MCU is sending bytes over the serial port? Do not connect the agent for testing.

pablogs9 avatar Aug 16 '23 09:08 pablogs9

Can you help me, i dont know at the moment how to force to send or to see bytes over the DMA Transport system. Im a beginner to work with the MicroROS Stack.

In Case you need more details here is my main.c file: `#if 0 /* USER CODE END Header / / Includes ------------------------------------------------------------------*/ #include "main.h" #include "cmsis_os.h" #include "lwip.h"

/* Private includes ----------------------------------------------------------/ / USER CODE BEGIN Includes */

#else

/**** No FreeRTOS Wrapper Functions ****/ #include "main.h" #include "lwip.h" #include "FreeRTOS.h" #include "task.h" #include "queue.h" #include "timers.h"

#endif

/**** Micro-ROS Libraries ****/ #include <rcl/rcl.h> #include <rcl/error_handling.h> #include <rclc/rclc.h> #include <rclc/executor.h> #include <uxr/client/transport.h> #include <rmw_microxrcedds_c/config.h> #include <rmw_microros/rmw_microros.h>

/**** ROS Message Typen ****/ #include <std_msgs/msg/int32.h> #include <geometry_msgs/msg/twist.h>

/**** Standard Libraries ****/ #include "stdio.h" #include "stdlib.h" #include "string.h"

/**** Ethernet TCP Socket Librearies ****/ #include "sys/socket.h" #include "sys/types.h"

/* USER CODE END Includes */

/* Private typedef -----------------------------------------------------------/ / USER CODE BEGIN PTD */

/**** Define Variables ****/ #define HEARTBEAT_HZ 500 //Heartbeat in [ms] (1Hz)

#define SOCK_PORT 8888 // Server Socket Port #define SOCK_ADDR "192.168.178.38" // Server Socket Adress

/**** Subscription ****/ #define RCCHECK(fn) { rcl_ret_t temp_rc = fn; if((temp_rc != RCL_RET_OK)){error_loop();}} #define RCSOFTCHECK(fn) { rcl_ret_t temp_rc = fn; if((temp_rc != RCL_RET_OK)){error_loop();}}

/* USER CODE END PTD */

/* Private define ------------------------------------------------------------/ / USER CODE BEGIN PD */

/* USER CODE END PD */

/* Private macro -------------------------------------------------------------/ / USER CODE BEGIN PM */

#if 0

/* USER CODE END PM */

/* Private variables ---------------------------------------------------------*/

UART_HandleTypeDef huart3; DMA_HandleTypeDef hdma_usart3_rx; DMA_HandleTypeDef hdma_usart3_tx;

/* Definitions for defaultTask / osThreadId_t defaultTaskHandle; const osThreadAttr_t defaultTask_attributes = { .name = "defaultTask", .stack_size = 3500 * 4, .priority = (osPriority_t) osPriorityNormal, }; / USER CODE BEGIN PV */ #else

/* Private variables ---------------------------------------------------------*/

UART_HandleTypeDef huart3; DMA_HandleTypeDef hdma_usart3_rx; DMA_HandleTypeDef hdma_usart3_tx;

/**** Software Timer Handler ****/ TimerHandle_t xHeartbeat;

#endif

#if 0 /* USER CODE END PV */

/* Private function prototypes -----------------------------------------------*/ void SystemClock_Config(void); static void MX_GPIO_Init(void); static void MX_DMA_Init(void); static void MX_USART3_UART_Init(void); void StartDefaultTask(void *argument);

/* USER CODE BEGIN PFP */

#else

/* Private function prototypes -----------------------------------------------*/ void SystemClock_Config(void); static void MX_GPIO_Init(void); static void MX_DMA_Init(void); static void MX_USART3_UART_Init(void);

#endif

/**** Tasks created ****/ void vTask_Publisher(void *pvParameters); void vTask_Subscriber(void *pvParameters);

/**** Functions needed for Publishing / bool cubemx_transport_open(struct uxrCustomTransport * transport); bool cubemx_transport_close(struct uxrCustomTransport * transport); size_t cubemx_transport_write(struct uxrCustomTransport transport, const uint8_t * buf, size_t len, uint8_t * err); size_t cubemx_transport_read(struct uxrCustomTransport transport, uint8_t buf, size_t len, int timeout, uint8_t err);

void * microros_allocate(size_t size, void * state); void microros_deallocate(void * pointer, void * state); void * microros_reallocate(void * pointer, size_t size, void * state); void * microros_zero_allocate(size_t number_of_elements, size_t size_of_element, void * state);

/* USER CODE END PFP */

/* Private user code ---------------------------------------------------------/ / USER CODE BEGIN 0 */

/**** Heartbeat Callback / void vHeartbeatCallback(TimerHandle_t xTimer) { / Toggle Blue LED with 1 Hz ****/ HAL_GPIO_TogglePin(LED_BLUE_GPIO_Port, LED_BLUE_Pin); }

/**** Twist Message Callback for Subscription ****/ void subscription_callback(const void *msgin) { const geometry_msgs__msg__Twist * msg = (const geometry_msgs__msg__Twist *)msgin;

/**** If Velocity in x direction is 0 toggle LED ****/
if(msg->linear.x ==0){

	HAL_GPIO_TogglePin(LED_RED_GPIO_Port, LED_RED_Pin);
}

}

void error_loop(){} /* USER CODE END 0 */

/**

  • @brief The application entry point.

  • @retval int / int main(void) { / USER CODE BEGIN 1 */

    /* USER CODE END 1 */

    /* MCU Configuration--------------------------------------------------------*/

    /* Reset of all peripherals, Initializes the Flash interface and the Systick. */ HAL_Init();

    /* USER CODE BEGIN Init */

    /* USER CODE END Init */

    /* Configure the system clock */ SystemClock_Config();

    /* USER CODE BEGIN SysInit */

    /**** init code for LWIP ****/ MX_LWIP_Init();

    /* USER CODE END SysInit */

    /* Initialize all configured peripherals / MX_GPIO_Init(); MX_DMA_Init(); MX_USART3_UART_Init(); / USER CODE BEGIN 2 */

#if 0 /* USER CODE END 2 */

/* Init scheduler */
osKernelInitialize();

/* USER CODE BEGIN RTOS_MUTEX */

#else

#endif /* add mutexes, ... / / USER CODE END RTOS_MUTEX */

/* USER CODE BEGIN RTOS_SEMAPHORES */
/* add semaphores, ... */
/* USER CODE END RTOS_SEMAPHORES */

/* USER CODE BEGIN RTOS_TIMERS */

/**** Create Software Timer  ****/
xHeartbeat= xTimerCreate ("Heartbeat", pdMS_TO_TICKS(HEARTBEAT_HZ), pdTRUE, 0, vHeartbeatCallback);

/**** Timer Start ****/
xTimerStart(xHeartbeat,0);

/* USER CODE END RTOS_TIMERS */

/* USER CODE BEGIN RTOS_QUEUES */
/* add queues, ... */

#if 0 /* USER CODE END RTOS_QUEUES */

/* Create the thread(s) */
/* creation of defaultTask */
defaultTaskHandle = osThreadNew(StartDefaultTask, NULL, &defaultTask_attributes);

/* USER CODE BEGIN RTOS_THREADS */

#else

if(xTaskCreate(vTask_Publisher, "Publisher", 3500, NULL, 3, NULL) != pdPASS)
{
	/**** Task not created ****/
	Error_Handler();
}

//	if(xTaskCreate(vTask_Subscriber, "Subscriber", 3000, NULL, 3, NULL) != pdPASS)
//	{
//		/**** Task not created ****/
//		Error_Handler();
//	}

#endif /* add threads, ... / / USER CODE END RTOS_THREADS */

/* USER CODE BEGIN RTOS_EVENTS */
/* add events, ... */

#if 0 /* USER CODE END RTOS_EVENTS */

/* Start scheduler */
osKernelStart();

/* We should never get here as control is now taken by the scheduler */
/* Infinite loop */
/* USER CODE BEGIN WHILE */

#else

/**** Start Scheduler ****/
vTaskStartScheduler();

#endif

while (1)
{
	/* USER CODE END WHILE */

	/* USER CODE BEGIN 3 */
}
/* USER CODE END 3 */

}

/**

  • @brief System Clock Configuration

  • @retval None */ void SystemClock_Config(void) { RCC_OscInitTypeDef RCC_OscInitStruct = {0}; RCC_ClkInitTypeDef RCC_ClkInitStruct = {0}; RCC_PeriphCLKInitTypeDef PeriphClkInitStruct = {0};

    /** Configure the main internal regulator output voltage / __HAL_RCC_PWR_CLK_ENABLE(); __HAL_PWR_VOLTAGESCALING_CONFIG(PWR_REGULATOR_VOLTAGE_SCALE1); /* Initializes the RCC Oscillators according to the specified parameters

    • in the RCC_OscInitTypeDef structure. / RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSE; RCC_OscInitStruct.HSEState = RCC_HSE_ON; RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON; RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSE; RCC_OscInitStruct.PLL.PLLM = 4; RCC_OscInitStruct.PLL.PLLN = 216; RCC_OscInitStruct.PLL.PLLP = RCC_PLLP_DIV2; RCC_OscInitStruct.PLL.PLLQ = 2; RCC_OscInitStruct.PLL.PLLR = 2; if (HAL_RCC_OscConfig(&RCC_OscInitStruct) != HAL_OK) { Error_Handler(); } /* Activate the Over-Drive mode / if (HAL_PWREx_EnableOverDrive() != HAL_OK) { Error_Handler(); } /* Initializes the CPU, AHB and APB buses clocks */ RCC_ClkInitStruct.ClockType = RCC_CLOCKTYPE_HCLK|RCC_CLOCKTYPE_SYSCLK |RCC_CLOCKTYPE_PCLK1|RCC_CLOCKTYPE_PCLK2; RCC_ClkInitStruct.SYSCLKSource = RCC_SYSCLKSOURCE_PLLCLK; RCC_ClkInitStruct.AHBCLKDivider = RCC_SYSCLK_DIV1; RCC_ClkInitStruct.APB1CLKDivider = RCC_HCLK_DIV4; RCC_ClkInitStruct.APB2CLKDivider = RCC_HCLK_DIV2;

    if (HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_LATENCY_7) != HAL_OK) { Error_Handler(); } PeriphClkInitStruct.PeriphClockSelection = RCC_PERIPHCLK_USART3; PeriphClkInitStruct.Usart3ClockSelection = RCC_USART3CLKSOURCE_PCLK1; if (HAL_RCCEx_PeriphCLKConfig(&PeriphClkInitStruct) != HAL_OK) { Error_Handler(); } }

/**

  • @brief USART3 Initialization Function

  • @param None

  • @retval None */ static void MX_USART3_UART_Init(void) {

    /* USER CODE BEGIN USART3_Init 0 */

    /* USER CODE END USART3_Init 0 */

    /* USER CODE BEGIN USART3_Init 1 */

    /* USER CODE END USART3_Init 1 / huart3.Instance = USART3; huart3.Init.BaudRate = 115200; huart3.Init.WordLength = UART_WORDLENGTH_8B; huart3.Init.StopBits = UART_STOPBITS_1; huart3.Init.Parity = UART_PARITY_NONE; huart3.Init.Mode = UART_MODE_TX_RX; huart3.Init.HwFlowCtl = UART_HWCONTROL_NONE; huart3.Init.OverSampling = UART_OVERSAMPLING_16; huart3.Init.OneBitSampling = UART_ONE_BIT_SAMPLE_DISABLE; huart3.AdvancedInit.AdvFeatureInit = UART_ADVFEATURE_NO_INIT; if (HAL_UART_Init(&huart3) != HAL_OK) { Error_Handler(); } / USER CODE BEGIN USART3_Init 2 */

    /* USER CODE END USART3_Init 2 */

}

/**

  • Enable DMA controller clock */ static void MX_DMA_Init(void) {

    /* DMA controller clock enable */ __HAL_RCC_DMA1_CLK_ENABLE();

    /* DMA interrupt init / / DMA1_Stream1_IRQn interrupt configuration / HAL_NVIC_SetPriority(DMA1_Stream1_IRQn, 5, 0); HAL_NVIC_EnableIRQ(DMA1_Stream1_IRQn); / DMA1_Stream3_IRQn interrupt configuration */ HAL_NVIC_SetPriority(DMA1_Stream3_IRQn, 5, 0); HAL_NVIC_EnableIRQ(DMA1_Stream3_IRQn);

}

/**

  • @brief GPIO Initialization Function

  • @param None

  • @retval None */ static void MX_GPIO_Init(void) { GPIO_InitTypeDef GPIO_InitStruct = {0};

    /* GPIO Ports Clock Enable */ __HAL_RCC_GPIOC_CLK_ENABLE(); __HAL_RCC_GPIOH_CLK_ENABLE(); __HAL_RCC_GPIOA_CLK_ENABLE(); __HAL_RCC_GPIOB_CLK_ENABLE(); __HAL_RCC_GPIOG_CLK_ENABLE();

    /*Configure GPIO pin Output Level */ HAL_GPIO_WritePin(GPIOB, LED_GREEN_Pin|LED_RED_Pin|LED_BLUE_Pin, GPIO_PIN_RESET);

    /*Configure GPIO pin : USER_PUSH_Pin */ GPIO_InitStruct.Pin = USER_PUSH_Pin; GPIO_InitStruct.Mode = GPIO_MODE_INPUT; GPIO_InitStruct.Pull = GPIO_NOPULL; HAL_GPIO_Init(USER_PUSH_GPIO_Port, &GPIO_InitStruct);

    /*Configure GPIO pins : LED_GREEN_Pin LED_RED_Pin LED_BLUE_Pin */ GPIO_InitStruct.Pin = LED_GREEN_Pin|LED_RED_Pin|LED_BLUE_Pin; GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP; GPIO_InitStruct.Pull = GPIO_NOPULL; GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW; HAL_GPIO_Init(GPIOB, &GPIO_InitStruct);

}

/* USER CODE BEGIN 4 */

/* USER CODE END 4 */

/* USER CODE BEGIN 5 */

void vTask_Publisher(void pvParameters) { /**************************************** micro-ROS Initialization configuration ****************************************/ #if 0 struct sockaddr_in remote_addr; remote_addr.sin_family = AF_INET; remote_addr.sin_port = htons(SOCK_PORT); remote_addr.sin_addr.s_addr = inet_addr(SOCK_ADDR);

/**** Sets micro-ROS default custom transport ****/
rmw_uros_set_custom_transport(
		true, // Enable XRCE framing
		(void *) &remote_addr,
		cubemx_transport_open,
		cubemx_transport_close,
		cubemx_transport_write,
		cubemx_transport_read);

#else /**** Sets micro-ROS default custom transport ****/ rmw_uros_set_custom_transport( true, // Enable XRCE framing (void *) &huart3, cubemx_transport_open, cubemx_transport_close, cubemx_transport_write, cubemx_transport_read); #endif

rcl_allocator_t freeRTOS_allocator = rcutils_get_zero_initialized_allocator();
freeRTOS_allocator.allocate = microros_allocate;
freeRTOS_allocator.deallocate = microros_deallocate;
freeRTOS_allocator.reallocate = microros_reallocate;
freeRTOS_allocator.zero_allocate =  microros_zero_allocate;

if (!rcutils_set_default_allocator(&freeRTOS_allocator))
{
	printf("Error on default allocators (line %d)\n", __LINE__);
}


/************************************************ micro-ROS app *******************************************/

/**** creating Publisher, msg, allocator, support und Node ****/
rcl_node_t node;
rclc_support_t support;
rcl_allocator_t allocator= rcl_get_default_allocator();

#if 1

/**** Initialize and modify options (Set ROS Domain ID) ****/
rcl_init_options_t init_options = rcl_get_zero_initialized_init_options();
rcl_init_options_init(&init_options, allocator); // IF 0 = RCL_RET_OK;
//rcl_init_options_fini(&init_options);
rcl_init_options_set_domain_id(&init_options, 11); // Domain ID is 11 | IF 0 = RCL_RET_OK;

/**** create init_options ****/
uint8_t test_supp_init=0;
if ((test_supp_init= rclc_support_init_with_options(&support, 0, NULL, &init_options, &allocator)) == (RCL_RET_INVALID_ARGUMENT || RCL_RET_ERROR))
{
	/**** Cant Create init options ****/
	//Error_Handler();
}

#else /**** create init_options / uint8_t test_supp_init=0; if ((test_supp_init= rclc_support_init(&support, 0, NULL, &allocator)) == (RCL_RET_INVALID_ARGUMENT || RCL_RET_ERROR)) { / Cant Create init options ****/ //Error_Handler(); } #endif

/**** create node ****/
rclc_node_init_default(&node, "publisher_node", "" , &support);

/**** Create Message, topic and publisher ****/
rcl_publisher_t publisher;
const char * topic = "kurwa";
const rosidl_message_type_support_t * msg_type = ROSIDL_GET_MSG_TYPE_SUPPORT(std_msgs, msg, Int32);

/**** create publisher ****/
if(rclc_publisher_init_default(&publisher, &node, msg_type, topic) != RCL_RET_OK)
{
	/**** Cant Create Publisher ****/
	//Error_Handler();
}

/**** published message has to be allocated statically ****/
std_msgs__msg__Int32 pub_msg;
std_msgs__msg__Int32__init(&pub_msg);

/**** Set Counter ****/
pub_msg.data=0;

/**** Ueberpruefe ob publisher funktioniert ****/

//RCL_RET_INVALID_ARGUMENT; value=11
//RCL_RET_PUBLISHER_INVALID; value=300
//RCL_RET_ERROR; value=1
//RCL_RET_BAD_ALLOC; value 10
//RCL_RET_OK; value=0

for(;;)
{
	/**** Publish the Message ****/
	rcl_ret_t ret = rcl_publish(&publisher, &pub_msg, NULL);
	if (ret != RCL_RET_OK)
	{
		/**** Error Publishing ****/
		printf("Error publishing (line %d)\n", __LINE__);
	}

	/**** Increment Counter ****/
	pub_msg.data++;
	vTaskDelay(10);

} // end for(;;)


/******************************************* Clean Up ********************************************************/

/****Destroy created entities ****/
rcl_publisher_fini(&publisher, &node);

/**** Destroy node ****/
rcl_node_fini(&node);

/**** Dealocates Object ****/
rclc_support_fini(&support);

} // end Publisher Task

void vTask_Subscriber(void pvParameters) { /*** micro-ROS Initialisation configuration ****/

/**** Sets micro-ROS default custom transport ****/
rmw_uros_set_custom_transport(
		true, // Set XCRE-Agent on
		(void *) &huart3,
		cubemx_transport_open,
		cubemx_transport_close,
		cubemx_transport_write,
		cubemx_transport_read);


rcl_allocator_t freeRTOS_allocator = rcutils_get_zero_initialized_allocator();
freeRTOS_allocator.allocate = microros_allocate;
freeRTOS_allocator.deallocate = microros_deallocate;
freeRTOS_allocator.reallocate = microros_reallocate;
freeRTOS_allocator.zero_allocate =  microros_zero_allocate;

if (!rcutils_set_default_allocator(&freeRTOS_allocator))
{
	printf("Error on default allocators (line %d)\n", __LINE__);
}

/**** Micro Ros App ****/
rcl_subscription_t subscriber;
geometry_msgs__msg__Twist msg;
rclc_executor_t executor;
rcl_allocator_t allocator;
rclc_support_t support;
rcl_node_t node;

allocator = rcl_get_default_allocator();

/**** create init options ****/
RCCHECK(rclc_support_init(&support,0,NULL, &allocator));

/**** create node ****/
RCCHECK(rclc_node_init_default(&node, "subscriber_node", "", &support));

/**** create subscriber ****/
RCCHECK(rclc_subscription_init_default(&subscriber, &node, ROSIDL_GET_MSG_TYPE_SUPPORT(geometry_msgs, msg, Twist), "kurwa_subscriber"));

/**** create executor ****/
RCCHECK(rclc_executor_init(&executor, &support.context, 1, &allocator));
RCCHECK(rclc_executor_add_subscription(&executor, &subscriber, &msg, &subscription_callback, ON_NEW_DATA));

for(;;)
{
	vTaskDelay(1000);
	RCCHECK(rclc_executor_spin_some(&executor, RCL_MS_TO_NS(100)));
}

}

/* USER CODE END 5 */

/**

  • @brief Period elapsed callback in non blocking mode

  • @note This function is called when TIM6 interrupt took place, inside

  • HAL_TIM_IRQHandler(). It makes a direct call to HAL_IncTick() to increment

  • a global variable "uwTick" used as application time base.

  • @param htim : TIM handle

  • @retval None */ void HAL_TIM_PeriodElapsedCallback(TIM_HandleTypeDef htim) { / USER CODE BEGIN Callback 0 */

    /* USER CODE END Callback 0 / if (htim->Instance == TIM6) { HAL_IncTick(); } / USER CODE BEGIN Callback 1 */

    /* USER CODE END Callback 1 */ }

/**

  • @brief This function is executed in case of error occurrence.
  • @retval None / void Error_Handler(void) { / USER CODE BEGIN Error_Handler_Debug / / User can add his own implementation to report the HAL error return state / //__disable_irq(); while (1) { } / USER CODE END Error_Handler_Debug */ }

#ifdef USE_FULL_ASSERT /**

  • @brief Reports the name of the source file and the source line number
  •     where the assert_param error has occurred.
    
  • @param file: pointer to the source file name
  • @param line: assert_param error line source number
  • @retval None */ void assert_failed(uint8_t file, uint32_t line) { / USER CODE BEGIN 6 / / User can add his own implementation to report the file name and line number, ex: printf("Wrong parameters value: file %s on line %d\r\n", file, line) / / USER CODE END 6 / } #endif / USE_FULL_ASSERT */`

28marcel28 avatar Aug 16 '23 10:08 28marcel28

I just remembered this issue where there were problems in rclc_support_init: https://github.com/micro-ROS/micro_ros_stm32cubemx_utils/issues/110

It was a matter of allocators, could you just read this issue and replicate its solution?

pablogs9 avatar Aug 16 '23 10:08 pablogs9

So, i understand, that the problem can be a bad Allocation. Does that mean, i can use the normal alloc malloc, free functions to replace following: rcl_allocator_t freeRTOS_allocator = rcutils_get_zero_initialized_allocator(); freeRTOS_allocator.allocate = microros_allocate; freeRTOS_allocator.deallocate = microros_deallocate; freeRTOS_allocator.reallocate = microros_reallocate; freeRTOS_allocator.zero_allocate = microros_zero_allocate;

I couldnt see any wrapper functions to solve the problem in the mentioned issue: #110

28marcel28 avatar Aug 16 '23 10:08 28marcel28

Hi @28marcel28, did you find a solution for this problem?

danielallstar avatar Sep 08 '23 13:09 danielallstar

Hey @danielallstar, we didnt find a solution for the STM32F767ZI. But we changed the board to the STM32F401re and it works fine! But we assume that the Transport Layer has an Hardware problem via USART and UART. This board isnt compatible for the present Microros-Stack!

28marcel28 avatar Sep 12 '23 12:09 28marcel28

@danielallstar @28marcel28 I have the same problem as you using the STM32F103ZE. finally,I find a solution from the suggetion of pablogs9. the stack of microros task is too small. const osThreadAttr_t defaultTask_attributes = { .name = "defaultTask", .stack_size = 128 * 16, //.stack_size = 128 * 4 .priority = (osPriority_t) osPriorityNormal, };

zp1915 avatar May 27 '24 06:05 zp1915