lamik/MAX30102_STM32_HAL

Unable to detect my finger and ever get a reading

Opened this issue · 7 comments

I am using the stm32 blue pill. Thanks for sharing a quick start, this sensor has not been easy! Now hooking up my sensor and inspecting it via stm32cubeide live I can see in the Max30102_Init(huart**) everything is HAL OK, which is good..

going into Max30102_Task(void) the conditional block if(IsFingerOnScreen) is always false and never runs? where is this global var even located as it never is assigned and never takes on a value from what I see? Even if I comment that conditional out and run the below code the only values I see here are

uch_addr	uint8_t	13 '\r'	
uch_addr@entry	uint8_t	13 '\r'	
uch_data	uint8_t	36 '$'	

so from the task I can ever switch(StateMachine)
but after the sensor is unable to detect my finger? any idea why?

the variables that I have created


    uint32_t heartRate = Max30102_GetHeartRate();
    uint32_t spo2 = Max30102_GetSpO2Value();

never contain any values ...

to confirms the SDA and SCK lines are hooked up properly, 3.3 V coming in along with the pull-up resistors attached. I can see the LED flash between cycles other than that I am unable to get anything working on it

lamik commented

I will give that a try later, thanks for your reply

@lamik I checked voltage it looks fine, tried the 3.3 V again and the 5 V with the same results - It is never able to detect my finger . Inspecting more carefully ( after I comment out the finger checking conditional ) to force it to go into the sampling I notice I am getting a memory error when my code goes into the algorithm file.. It should be noted I am using the STM32 blue pill which has lower memory than your nuecleo but I even dropped down the sampling to the lowest and still encounter this stepping through I do notice some values in the debugger, could you confirm these are accurate?

lamik commented

So what I think is happening actually is quite simply the memory restrictions on the blue pill can not handle the expanding stack.

I have STM32 (Blue Pill) ARM Cortex M3 72Mhz, 64kB Flash, 20Kb RAM - STM32F103C8

the loops are really hurting me, trying to find a way to shrink what you have or at least provide the bare min functionality of getting a SPO2 and Heart Rate without too much onboard processing. I will keep you updated though!

lamik commented