Loading...
 

SW4STM32 and SW4Linux fully supports the STM32MP1 asymmetric multicore Cortex/A7+M4 MPUs

   With System Workbench for Linux, Embedded Linux on the STM32MP1 family of MPUs from ST was never as simple to build and maintain, even for newcomers in the Linux world. And, if you install System Workbench for Linux in System Workbench for STM32 you can seamlessly develop and debug asymmetric applications running partly on Linux, partly on the Cortex-M4.
You can get more information from the ac6-tools website and download (registration required) various documents highlighting:

System Workbench for STM32


Trying to make a simple UART usage project, with interrupts

So i tried to build this little project, generated with STM32CubeMX.
The only line of codes i wrote were


void UART5_IRQHandler(void)
{
HAL_UART_Receive(&huart5,&box,3,500);
HAL_UART_Transmit(&huart5,&box,3,500);

}

where box is an extern uint8_t array of 3 elements.

When i try to build this unfortunately i get 2 errors on these 2 function calls. They both say ‘error: subscripted value is neither array nor pointer nor vector’.

Can somebody help me point out what i did wrong here?

Thanks in advance.

Hi,

CutPast from my code :

if(HAL_UART_Transmit(&UartHandleESP, (uint8_t*)aTxBuffer, strlen(aTxBuffer), 5000)!= HAL_OK)
{
Error_Handler();
}


if(HAL_UART_Receive(&UartHandleESP, (uint8_t *)aRxBuffer, 10, 5000) != HAL_OK)
{
Error_Handler();
}


with :
(should use malloc on definitive code)
uint8_t aTxBuffer100;
uint8_t aRxBuffer100;


France

Hi,

As, in C, the name of an array is in fact a pointer to its first element, in your code, the second parameter to HAL_UART_Receive/Transmit (which should be a pointer to a uint8_t) is a pointer to an array of uint8_t, which is in fact a pointer to a (litteral) pointer to an uint_t, so the error (which is quite informative, as it says that it can’t index the address of an array).

Here you should just pass box (and not &box).

Bernard (Ac6)

did what you told and, yep i probably didn’t think too much about that.
But now these weird errors popped out, see the screen attached.

How is it supposed to happen?