This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Having issues compiling various CMSIS drivers for the LPC4357

I have been trying to compile the drivers for the LPC4357 found at www.lpcware.com/.../lpc4350apdlzip for a while now, but I keep getting lots of strange errors, usually something like this:

compiling lpc43xx_i2c.c...
H:\LPC4357\Source\lpc43xx_i2c.c(1155): error: #136: struct "<unnamed>" has no field "MASK" I2Cx->MASK[0] = I2C_I2MASK_MASK((uint32_t) \
H:\LPC4357\Source\lpc43xx_i2c.c(1160): error: #136: struct "<unnamed>" has no field "MASK" I2Cx->MASK[1] = I2C_I2MASK_MASK((uint32_t) \
H:\LPC4357\Source\lpc43xx_i2c.c(1165): error: #136: struct "<unnamed>" has no field "MASK" I2Cx->MASK[2] = I2C_I2MASK_MASK((uint32_t) \
H:\LPC4357\Source\lpc43xx_i2c.c(1170): error: #136: struct "<unnamed>" has no field "MASK" I2Cx->MASK[3] = I2C_I2MASK_MASK((uint32_t) \
H:\LPC4357\Source\lpc43xx_i2c.c: 0 warnings, 4 errors

There are various other errors like this in a few of the other packages, but I can't quite seem to figure out how to get it to actually compile.

To make matters worse, the board I have came with a few example projects in Keil, which seem to be set up exactly the same in every option they have, and the source files are the same to the character, but it doesn't generate the error. Clearly I'm doing something wrong, but for the life of me I can't figure out what it is.

Any ideas?

  • Still can't figure this out. Anyone have any suggestions?

  • I tested the lpc43xx-2013-09-04.zip, but did not encounter the same problem.

    /*********************************************************************//**
     * @brief               Set Own slave address in I2C peripheral corresponding to
     *                              parameter specified in OwnSlaveAddrConfigStruct.
     * @param[in]   I2Cx    I2C peripheral selected, should be
     *                                      - LPC_I2C0      :I2C0 peripheral
     *                                      - LPC_I2C1      :I2C1 peripheral
     * @param[in]   OwnSlaveAddrConfigStruct        Pointer to a I2C_OWNSLAVEADDR_CFG_Type
     *                              structure that contains the configuration information for the
     *              specified I2C slave address.
     * @return              None
     **********************************************************************/
    void I2C_SetOwnSlaveAddr(LPC_I2Cn_Type *I2Cx, I2C_OWNSLAVEADDR_CFG_Type *OwnSlaveAddrConfigStruct)
    {
            uint32_t tmp;
            CHECK_PARAM(PARAM_I2Cx(I2Cx));
            CHECK_PARAM(PARAM_I2C_SLAVEADDR_CH(OwnSlaveAddrConfigStruct->SlaveAddrChannel));
            CHECK_PARAM(PARAM_FUNCTIONALSTATE(OwnSlaveAddrConfigStruct->GeneralCallState));
    
            tmp = (((uint32_t)(OwnSlaveAddrConfigStruct->SlaveAddr_7bit << 1)) \ 
                            | ((OwnSlaveAddrConfigStruct->GeneralCallState == ENABLE) ? 0x01 : 0x00))& I2C_I2ADR_BITMASK;
            switch (OwnSlaveAddrConfigStruct->SlaveAddrChannel)
            {
            case 0:
                    I2Cx->ADR0 = tmp;
    /*Line 1155*/            I2Cx->MASK[0] = I2C_I2MASK_MASK((uint32_t) \ 
                                    (OwnSlaveAddrConfigStruct->SlaveAddrMaskValue));
                    break;
    

    H:\LPC4357\Source\lpc43xx_i2c.c(1155): error: #136: struct "<unnamed>" has no field "MASK" I2Cx->MASK[0] = I2C_I2MASK_MASK((uint32_t) \

    You need to find the definition of LPC_I2Cn_Type that Keil tool-chain uses.