2014-10-16 03:24 AM
Hello,
I have some problems understanding and using the UART HAL component. The test application for the SPC560D sends ''Hello World'' with the chnWriteTimout() function. To send the value 0x55, I wrotechnWriteTimeout(&SD1, (uint8_t *)
0x55
, 2, TIME_INFINITE);But this did not work. I doesn´t matter which value I tried to send, I am always receiving a different value. Only when I am sending characters, the received data equals the sended data. What is wrong with my command?
My second question is: is it possible to write my own UART driver? The driver from the library is too complex for my application. I just want to periodically send data triggered by a timer interrupt and to work with the UART interrupt if I receive data. Therefore, I started to write my own driver. So I deactivated SERIAL in the configuration, but I am not able to configure LinFlex. Setting LinFlex to initialization mode by settingLINFLEX_0.
LINCR1
.
B
.
INIT
= 1;did not work. What would be the correct steps to be able to configure the LinFlex component?
Best regards,
PatrikSolved! Go to Solution.
2014-11-14 06:50 AM
const
uint8_t constHexToSend = 0x55;
chnWriteTimeout(&SD1, (uint8_t *)&constHexToSend, 1, TIME_INFINITE);
Best regards
Erwan
2014-10-23 02:20 AM
Hello,
Finally, I was able to understand how I can adapt the UART component to send the commands I needed. Currently, I am using two interfaces: UART and SPI. The SPI communication runs periodically every 1ms. When I additionally send some commands over UART, the program always jumps to the adress 0x000000E0 after a view milliseconds and hangs there. Looking in the out.map file, i found at this memory entry several _IVOR entries. Does anybody now what the reason for the jump to this adress could be and how I can avoid that? Best regards, Patrik2014-10-23 07:19 AM
Hello,
I just found out, that the controller (SPC560B) shows the same behaviour when I use only UART in software. I sent continously data with hyperterminal to the controller and I got the same error. As software project, I used the discovery board demo for SPC560B and adapted it for UART receive. Is this probably an error in the ST serial driver?2014-11-14 05:29 AM
Hello Patrik ,
it is important to put the exact size of your local array in this following function :chnWriteTimeout(&SD1, (uint8_t *) 0x55, 1, TIME_INFINITE);
Do you reproduce the similar issue with the application :
ChibiOS-RT SPC560Dxx Test Application for Discovery or ChibiOS-RT SPC560Bxx Test Application for Discovery ? anyway , we will check this issue. Best Regards Erwan2014-11-14 06:50 AM
const
uint8_t constHexToSend = 0x55;
chnWriteTimeout(&SD1, (uint8_t *)&constHexToSend, 1, TIME_INFINITE);
Best regards
Erwan