AnsweredAssumed Answered

SMBUS/PMBUS V2 (AN4502) integrated to CubeMX HAL problem

Question asked by loffan bertilsson on Jun 17, 2017
Latest reply on Dec 19, 2017 by Chester Lu

Hi, I need help with using the SMBUS/PMBUS V2 library with STM32 Cube HAL, https://my.st.com/content/my_st_com/en/products/embedded-software/mcus-embedded-software/stm32-embedded-software/stm32cube-expansion-software/x-cube-smbus.license%3d1497686538860.html

 

Whaterver I do I get the error: ..\Middlewares\ST\STM32_SMBus_Stack\inc\stm32_PMBUS_stack.h(410): error: #20: identifier "HAL_StatusTypeDef" is undefined

 

Even when I include the stm32f0xx_hal.h file in the Keil projec.

It can find it ok when i right click and "go to definition"

I just want to add and use the two files stm32_PMBUS_stack.c and stm32_SMBUS_stack.c with the corresponding .h files, but as soon as I include the .h files for the files in main.h then I have this problem.

 

I attach a cleanly generated project from CubeMx (latest version) and the example provided from ST is on this link: https://my.st.com/content/my_st_com/en/products/embedded-software/mcus-embedded-software/stm32-embedded-software/stm32cu… 

 

Both compile fine on there own but not when I try to include the stm32_SMBUS_stack and stm32_PMBUS_stack files in my CubeMx project.

 

The example for my board has this path in the example.

STM32_AN4502_FW_V2.0.0\Projects\STM32F072B-Discovery\MDK-ARM\Project.uvprojx

 

Also I have to add the #include <stdint.h> in the new files as it cant find the uint8_t definition otherwise, weird that it works without it in the ST example..

 

Thankful for all the help I can get as I have been struggling with this issue for weeks! Probably just a include chain modification somewhere that I cant find on my own.

 

Best regards

Christoffer

Attachments

Outcomes