cancel
Showing results for 
Search instead for 
Did you mean: 

STM32WB55RGV6 GPIO pin configuration ADS_DRDY_Pin is PC11. When I change GPIO_MODE_IT_RISING to GPIO _MODE_IT_FALLING, my ble server can not work normally. Rising is ok, but I can't find my ble device(in falling).

Lep
Senior

0693W00000SwBb6QAF.png0693W00000SwBbBQAV.pngADS_DRDY_Pin is PC11. When I change GPIO_MODE_IT_RISING to GPIO _MODE_IT_FALLING, my ble server can not work normally. Rising is ok, but I can't find my ble device(in falling). Thank in advance.

1 ACCEPTED SOLUTION

Accepted Solutions

Once again, is the code FULLY working with rising edge? Could you please test it again? Is there anything else you have changed?

Also, where do you call UTIL_SEQ_Run() if the last code-image is the main loop?

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

View solution in original post

13 REPLIES 13
Jaroslav JANOS
ST Employee

Hello,

so the ADS_DRDY is some external signal? Could you please give us more information about this?

Also, why have you changed the pull-down to pull-up?

Jaroslav

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

Thank you. ��

It's no pull, the picture is wrong.

When I use raising edge external interruption, all is well.

When I use falling edge external interruption, the led can toggle, but I can't find my BLE device (BLE can't work). Can I think the cause of my problem is on the bluetooth side?

​If so, I still don't know how to fix it.

The ADS_DRDY signal are as follows(ads1299 datasheet):0693W00000SwDdOQAV.png0693W00000SwDeCQAV.png

OK, I still don't see how the DRDY interrupt is tied with the BLE. Are you waiting on some data, or just for start of the ADS? The led is toggled in the interrupt, or in the main code?

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

① I am waiting on BLE server notifications (data collected by ADS1299).

②​ The led toggled in the interrupt.

③​ Interruption and Bluetooth transmission notification are as follows:

I made a board with STM32WB55RGV6 as ble server.

1.First is the interrupt handling function.

0693W00000SwDssQAF.png​The task performed is the function read_fecg().

2.The second step is to run the function read_ fecg().

ADS_updateChannelData() updates ads1299's data.

HAL_GPIO_Toggle() controls led on or off.

APP_BLE_ADS1299_Action updates server notifications(ads1299 data).

0693W00000SwDuKQAV.png3.0693W00000SwDwBQAV.pngFECG_UpdateMeasurement includes data classification and ble notification update.

Thank you for the explanation.

Well, if with the rising edge everything works fine and the data are OK, the only idea is that the data from the ADS might be corrupted (read with wrong timing?), your classification fails and the BLE part is not even executed...

Try to debug the FECG_UpdateMeasurement() function, at least with the pin toggling, to see if the BLE update part is even executed.

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

Thank you for clearing my doubts. ��

I found that the problem is on the function APP_BLE_ADS1299_Action().

0693W00000SwG0ZQAV.png0693W00000SwG0jQAF.png0693W00000SwG0yQAF.pngFECG_UpadateMeasurement() executes P2PS_Send_Notification_Task_FECG().

0693W00000SwG2aQAF.pngI found that even if I commented out all this function, it is still unsuccessful. ��

1. Comment all, fail0693W00000SwGBhQAN.png2.Comment out the data to be transferred and only transfer 15 0 elements. The result still fails.

0693W00000SwGBwQAN.png 

Why do I change from raising to falling and bluetooth doesn't work. ��

I speculate that it may be the scheduler, even if the task to be executed is an empty function(P2PS_Send_Notification_Task_FECG).Actually the scheduler will execute this function.

UTIL_SEQ_SetTask( 1<<CFG_TASK_FECG_EVT_ID,CFG_SCH_PRIO_0);

Is it possible that the scheduler polling will generate an error because I use falling edge?

In fact, I just added two tasks such as red markers.0693W00000SwIgXQAV.png 

The ADS_DRDY signal (data ready signal) can be judged by the external edge interrupt method(HAL_GPIO_EXTI_CALLBACK) and reading the state of this pin(HAL_GPIO_ReadPin(ADS_DRDY_GPIO_Port, ADS_DRDY_Pin)).

For the second readpin method, how should I write the program?

Currently I only know about external trigger (HAL_GPIO_EXTI_CALLBACK) and virtual timer (HW_TS_Start), but I don't know how to read the AS_DRDY pin state and send notification program in the task scheduler (I don't think the above two methods are applicable).0693W00000SwKMeQAN.png