This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
Tool/software: Code Composer Studio
I'm trying to use the LDOPWR API with driver Lib, even when I use the provided examples, I get these errors:
"../main.c", line 54: warning #225-D: function "LDOPWR_unLockConfiguration" declared implicitly
"../main.c", line 54: error #20: identifier "LDOPWR_BASE" is undefined
"../main.c", line 57: warning #225-D: function "LDOPWR_enablePort_U_outputs" declared implicitly
"../main.c", line 60: warning #225-D: function "LDOPWR_setPort_U1_outputData" declared implicitly
"../main.c", line 61: error #20: identifier "LDOPWR_PORTU_PIN_HIGH" is undefined
"../main.c", line 65: warning #225-D: function "LDOPWR_setPort_U0_outputData" declared implicitly
"../main.c", line 66: error #20: identifier "LDOPWR_PORTU_PIN_LOW" is undefined
"../main.c", line 70: warning #225-D: function "LDOPWR_clearInterrupt" declared implicitly
"../main.c", line 71: error #20: identifier "LDOPWR_LDO_OVERLOAD_INDICATION_INTERRUPT" is undefined
"../main.c", line 73: warning #225-D: function "LDOPWR_enableInterrupt" declared implicitly
"../main.c", line 78: warning #225-D: function "LDOPWR_lockConfiguration" declared implicitly
"../main.c", line 90: warning #225-D: function "LDOPWR_togglePort_U1_outputData" declared implicitly
"../main.c", line 91: warning #225-D: function "LDOPWR_togglePort_U0_outputData" declared implicitly
"../main.c", line 84: remark #1527-D: (ULP 2.1) Detected SW delay loop using empty loop. Recommend using a timer module instead
4 errors detected in the compilation of "../main.c".
gmake: *** [main.obj] Error 1
gmake: Target 'all' not remade because of errors.
How do I solve this issue, I do not have problems with other API's.
Hi, I try to build the project again and the building is finished. My CCS version is 9.2 and compiler version is TI.v18.12.3. Thanks!
Hi,
I'm on CCS v10.1.0 and compiler version is Ti 20.2.1.LTS. None of the LDOPWR examples or self written functions are successfully built or debugged, the errors I mentioned before are persistent.
thanks,
Raghav
Hi Raghav
I try the project building on CCS v10.1 which is the same with your platform. The build is finished normally.
According to the errors information from you. some function and micro definition is abnormal. I checked the project, the functions are defined on ldopwr.c file and msp430f5310.h file (I select the target device as F5310)
the directory of ldopwr.c is msp430ware_3_80_11_07\driverlib\driverlib\MSP430F5xx_6xx
the directory of msp430f5310.h is ccs1010\ccs\ccs_base\msp430\include
I attached these 2 files as the reference. Please check if there are the same files on your CCS folder. Thanks!
//***************************************************************************** // // ldopwr.c - Driver for the ldopwr Module. // //***************************************************************************** //***************************************************************************** // //! \addtogroup ldopwr_api ldopwr //! @{ // //***************************************************************************** #include "inc/hw_memmap.h" #ifdef __MSP430_HAS_PU__ #include "ldopwr.h" #include <assert.h> void LDOPWR_unLockConfiguration ( uint16_t baseAddress ) { HWREG16(baseAddress + OFS_LDOKEYPID) = 0x9628; } void LDOPWR_lockConfiguration ( uint16_t baseAddress ) { HWREG16(baseAddress + OFS_LDOKEYPID) = 0x0000; } void LDOPWR_enablePort_U_inputs (uint16_t baseAddress ) { HWREG8(baseAddress + OFS_PUCTL_H) |= PUIPE_H; } void LDOPWR_disablePort_U_inputs (uint16_t baseAddress ) { HWREG8(baseAddress + OFS_PUCTL_H) &= ~PUIPE_H; } void LDOPWR_enablePort_U_outputs (uint16_t baseAddress ) { HWREG8(baseAddress + OFS_PUCTL_L) |= PUOPE; } void LDOPWR_disablePort_U_outputs (uint16_t baseAddress ) { HWREG8(baseAddress + OFS_PUCTL_L) &= ~PUOPE; } uint8_t LDOPWR_getPort_U1_inputData (uint16_t baseAddress ) { return ((HWREG8(baseAddress + OFS_PUCTL_L) & PUIN1) >> 3 ); } uint8_t LDOPWR_getPort_U0_inputData (uint16_t baseAddress ) { return ((HWREG8(baseAddress + OFS_PUCTL_L) & PUIN0) >> 2 ); } uint8_t LDOPWR_getPort_U1_outputData (uint16_t baseAddress ) { return ((HWREG8(baseAddress + OFS_PUCTL_L) & PUOUT1) >> 1 ); } uint8_t LDOPWR_getPort_U0_outputData (uint16_t baseAddress ) { return (HWREG8(baseAddress + OFS_PUCTL_L) & PUOUT0); } void LDOPWR_setPort_U1_outputData (uint16_t baseAddress, uint8_t value ) { if (LDOPWR_PORTU_PIN_HIGH == value){ HWREG8(baseAddress + OFS_PUCTL_L) |= PUOUT1; } else { HWREG8(baseAddress + OFS_PUCTL_L) &= ~PUOUT1; } } void LDOPWR_setPort_U0_outputData (uint16_t baseAddress, uint8_t value ) { if (LDOPWR_PORTU_PIN_HIGH == value){ HWREG8(baseAddress + OFS_PUCTL_L) |= PUOUT0; } else { HWREG8(baseAddress + OFS_PUCTL_L) &= ~PUOUT0; } } void LDOPWR_togglePort_U1_outputData (uint16_t baseAddress) { HWREG8(baseAddress + OFS_PUCTL_L) ^= PUOUT1; } void LDOPWR_togglePort_U0_outputData (uint16_t baseAddress) { HWREG8(baseAddress + OFS_PUCTL_L) ^= PUOUT0; } void LDOPWR_enableInterrupt (uint16_t baseAddress, uint16_t mask ) { HWREG8(baseAddress + OFS_LDOPWRCTL_H) |= mask; } void LDOPWR_disableInterrupt (uint16_t baseAddress, uint16_t mask ) { HWREG8(baseAddress + OFS_LDOPWRCTL_H) &= ~mask; } void LDOPWR_enable (uint16_t baseAddress) { HWREG8(baseAddress + OFS_LDOPWRCTL_H) |= LDOOEN_H; } void LDOPWR_disable (uint16_t baseAddress) { HWREG8(baseAddress + OFS_LDOPWRCTL_H) &= ~LDOOEN_H; } uint8_t LDOPWR_getInterruptStatus (uint16_t baseAddress, uint16_t mask ) { return (HWREG8(baseAddress + OFS_LDOPWRCTL_L) & mask); } void LDOPWR_clearInterrupt (uint16_t baseAddress, uint16_t mask ) { HWREG8(baseAddress + OFS_LDOPWRCTL_L) &= ~mask; } uint8_t LDOPWR_isLDOInputValid (uint16_t baseAddress) { return (HWREG8(baseAddress + OFS_LDOPWRCTL_L) & LDOBGVBV); } void LDOPWR_enableOverloadAutoOff (uint16_t baseAddress) { HWREG8(baseAddress + OFS_LDOPWRCTL_L) |= OVLAOFF_L; } void LDOPWR_disableOverloadAutoOff (uint16_t baseAddress) { HWREG8(baseAddress + OFS_LDOPWRCTL_L) &= ~OVLAOFF_L; } uint8_t LDOPWR_getOverloadAutoOffStatus (uint16_t baseAddress) { return (HWREG8(baseAddress + OFS_LDOPWRCTL_L) & OVLAOFF_L); } #endif //***************************************************************************** // //! Close the doxygen group for ldopwr_api //! @} // //*****************************************************************************
HI,
Both the files you referred to are In the correct directory. Just to confirm, I'm using the MSP430F5528 and not the MSP430F5310 like you are.
Thanks,
Raghav
When I add the project again from DriverLib but this time using the MSP430F5310 like yours, it complies. It only does not work for MSP430F5528.
THANKS,
Raghav
Hi Raghav,
The MSP430F531x doesn't have USB, while the MSP430F552x does. However, while the USB functionality is completely disabled in F531x, the one thing that is still enabled is the LDO, which is why they have some register compatibility.
These are the LDO registers in F531x:
And for F552x:
As observed, the LDOPWRCTL is in the same place as USBPWRCTL, and if you check the register description, you'll see that a lot of the registers will be the same, but not all.
So, my first question would be if you are planning to use USB? If you aren't, maybe you could consider the F531x or F532x families.
If you are planning to use USB, we recommend to use the USB library, which I think uses some of these registers and might cause conflicts if you want to handle it externally.
But if you are still interested in enabling the LDOPWR DriverLib in F552x, maybe you could try copy-pasting the register definition from the F5329 header file into your msp430FF5529.h:
I honestly can't say that I recommend this, since the register definition of both devices is different (i.e. USBPWRCTL.SLDOEN is available and initialized to 1 after reset for F5529, but LDOPWRCTL.LDOEN resides in the same location and it's is not available and it's initialized to 0 after reset in F5329). But I think it could build and maybe you could modify it to meet your needs.
Regards,
Luis R
**Attention** This is a public forum