2022-09-25 08:34 AM
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). Thank in advance.
Solved! Go to Solution.
2022-09-27 02:19 AM
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.
2022-09-25 11:51 PM
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.
2022-09-26 12:08 AM
Thank you. :beaming_face_with_smiling_eyes:
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):
2022-09-26 12:34 AM
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.
2022-09-26 12:56 AM
① 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.
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).
3.FECG_UpdateMeasurement includes data classification and ble notification update.
2022-09-26 05:20 AM
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.
2022-09-26 07:06 AM
Thank you for clearing my doubts. :beaming_face_with_smiling_eyes:
I found that the problem is on the function APP_BLE_ADS1299_Action().
FECG_UpadateMeasurement() executes P2PS_Send_Notification_Task_FECG().
I found that even if I commented out all this function, it is still unsuccessful. :face_with_tears_of_joy:
2022-09-26 07:36 AM
1. Comment all, fail2.Comment out the data to be transferred and only transfer 15 0 elements. The result still fails.
Why do I change from raising to falling and bluetooth doesn't work. :crying_face:
2022-09-26 07:22 PM
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.
2022-09-27 01:11 AM
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).