How to wake a thread in UART RX completed callback - stm32

I have a project using STM32F7-Discovery, and I have a couple of threads including UART thread with real time priority.
I use HAL_UART_Receive_IT() to get data,then I use osSignalWait( 0x01, osWaitForever) while I receive call-back interruption. I have verified that the interruption is occured, but the problem is when I want to wake my uart thread by osSignalSet( UART_ThreadId, 0x01 ), the micro controller is hanging.
How can I wake my uart thread ?

Related

STM32F030x sends ST20033000022056000063227OV every 5 seconds and cannot be programmed

I built 2 baremetal development boards, both using the STM32F030K6T6. The MCU on one board can be programmed as indicated in the datasheet using the boot pin selection and via USART pins PA14 and PA15. The second does not respond to flashing command and instead keeps sending the same message ST20033000022056000063227OV on the USART TX pin every 5 seconds with a 9600 baud rate.
I was not able to find any references related to this in the datasheet or elsewhere. I could just ditch the board but I'd like to understand what is it that's happening. It seems like the MCU is in some sort of a failure mode. What does the message mean?
I tried flashing using the stm32flash script available in the STM32 library for Arduino. The signal's baud rate was determined using a scope. The messages were then captured with:
cu -l /dev/ttyUSB0 -s 9600
Both MCUs came from the same batch and the development boards have the same aditional components (2 decoupling capacitors, a boot selector jumper and a reset button).

STM32F7 SPI interrupts stop working with FreeRTOS

I'm using stm33F7 reading sensor via SPI communication, it's working in slave only receive mode, I can read data in interrupt mode perfectly without os, but as I enable FreeRTOS (using STM32CUBE) after a random time interrupt stops firing. I'm also reading data from another sensor via UART communication with and without os, and in both modes it works fine, Is there any problem with using SPI Interrupt and FreeRTOS?
Is the interrupt handler using FreeRTOS API calls? If so you need to ensure the priority is set appropriately and that the STM32 has all priority bits set as preemption priority. This is described on the FreeRTOS website. Additionally, familiarise yourself with the FreeRTOS FAQ that covers common issues and how to detect them.
I solved my problem by changing SPI Interrupt Priority to 0. It's working perfectly now.

STM32F4 DISC1 CAN and USB peripheral together doesnt work

Hi I have a problem with stm32f4 disc1.
I can transmit over USB( USB_FS_CDC) message using CDC_Transmit and i can send CAN message but dont get interrupt for receiving CAN message. Interrupt occurs that can message is received only when i dont initialize USB_CDC.
Hi is it possible to use in the same time can and USB CDC because i need to receive message from can and then transmit over usb to PC?

Is it possible for slave devices to initiate communication with master - main processor in i2c protocol?

Can a device connected to main processor can initiate a i2c communication.
For example, FAN connected using i2c bus, is it possible for a FAN to send a feedback to main processor.
Common solution to a problem like this is to have a separate interrupt line.
I3C supports in-band interrupts, if you're not set on I2C yet.

External Accessory reading problem

I need to receive data periodically through a BlueTooth External Accessory.
I implemented an event-driven model of EA's streams. However, the initial transmission from bluetooth is always delayed. For example, if each packet was 15 bytes long, the stream delegate would not fires until about 150 bytes.
Will polling help?
EDIT:
Also I found it hard to recover the session after the app switching back from background to foreground. Trying to open session again would fail. Any idea?
Read every bytes when NSStreamEventHasBytesAvailable arrives.
Did you develop your own Bluetooth accessory? May be the MCU only flushes after sending every 150 bytes.
Also you mentioned initial transmission. Do you know once the Bluetooth device is paired and connected to iPhone, it has to go through some identification process, handshaking some secret certificate. This may take few and even 10 seconds, depending on signal quality. This may be the cause of delay.