Errors with my code: "Multiple definitions" and 'arm-none-eabi.exe' failed

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
lock attach
Attachments are accessible only for community members.
rbtics
Level 1
Level 1
10 sign-ins 5 replies posted 5 sign-ins

I am having trouble figuring out why these errors are occurring. I looked at my .h file and I only have macros defined so I don't know where the issue is occurring. Also, I am having trouble with trying to figure out the  'arm-none-eabi.exe' failed error. 

0 Likes
1 Solution
MotooTanaka
Level 9
Level 9
Distributor - Marubun (Japan)
First comment on blog Beta tester First comment on KBA

Hi,

Your attachment procedure was perfect!

 

Although it took me a while to figure out what the problem was,

I found the root cause of your problem.

Meantime, I can imagine that if PSoC Creator was supporting C++,

you did not have to have this trouble.

 

In my less than a half century  short programming experience

including a ".c" file has been always a source of problems.

IMHO, we should declare in ".h" and define ".c" and always include ".h"

 

Having written that at least I could make your project "compile-able"

but as I don't have your hardware, I could not test it.

So please test and fix the project at your side.

moto

View solution in original post

6 Replies
MotooTanaka
Level 9
Level 9
Distributor - Marubun (Japan)
First comment on blog Beta tester First comment on KBA

Hi,

I modified the beginning of bno_i2c.h as below and the project could be compiled.

=======================

// from support.c
s8 BNO055_I2C_bus_write(u8 dev_addr, u8 reg_addr, u8 *reg_data, u8 cnt) ;
s8 BNO055_I2C_bus_read(u8 dev_addr, u8 reg_addr, u8 *reg_data, u8 cnt) ;

/*************************************************/
/**\           GET AND SET BITSLICE FUNCTIONS    */
/*************************************************/
#define BNO055_GET_BITSLICE(regvar, bitname) \
    ((regvar & bitname##_MSK) >> bitname##_POS)

#define BNO055_SET_BITSLICE(regvar, bitname, val) \
    ((regvar & ~bitname##_MSK) | ((val << bitname##_POS) & bitname##_MSK))

#define BNO055_WR_FUNC_PTR    s8 (*BNO055_I2C_bus_write) \
        (u8, u8, u8 *, u8)

#define BNO055_BUS_WRITE_FUNC(dev_addr, reg_addr, reg_data, wr_len) \
    BNO055_I2C_bus_write(dev_addr, reg_addr, reg_data, wr_len)
    
//    bus_write(dev_addr, reg_addr, reg_data, wr_len)
    
#define BNO055_BUS_READ_FUNC(dev_addr, reg_addr, reg_data, r_len) \
    BNO055_I2C_bus_read(dev_addr, reg_addr, reg_data, r_len)
        
//    bus_read(dev_addr, reg_addr, reg_data, r_len)
#define BNO055_RD_FUNC_PTR   s8 (*BNO055_I2C_bus_read) \
    (u8, u8, u8 *, u8)
    
#define BNO055_DELAY_FUNC(delay_in_msec) \
    delay_func(delay_in_msec)
    

struct bno055_t
{
    u8 chip_id; /**< chip_id of bno055 */
    u16 sw_rev_id; /**< software revision id of bno055 */
    u8 page_id; /**< page_id of bno055 */
    u8 accel_rev_id; /**< accel revision id of bno055 */
    u8 mag_rev_id; /**< mag revision id of bno055 */
    u8 gyro_rev_id; /**< gyro revision id of bno055 */
    u8 bl_rev_id; /**< boot loader revision id of bno055 */
    u8 dev_addr; /**< i2c device address of bno055 */
    BNO055_WR_FUNC_PTR ; /**< bus write function pointer */
    BNO055_RD_FUNC_PTR ; /**<bus read function pointer */
    void (*delay_msec)(BNO055_MDELAY_DATA_TYPE); /**< delay function pointer */
};

=======================

'arm-none-eabi.exe' failed error. 

This error happens whenever previously some errors detected and could not complete the build.

So if there is/are no error, this will not be shown.

 

moto

0 Likes

Hi,

I changed what I had to what you recommended but I'm still getting the same errors. For reference, I only get the errors when I am debugging and connected to my device (PSoC 4200L CY8C4248BZI-L489).

0 Likes
MotooTanaka
Level 9
Level 9
Distributor - Marubun (Japan)
First comment on blog Beta tester First comment on KBA

Hi,

If you can build the project I attached, your environment does not have a problem.

Then I suppose that the remaining problem is in your project.

It would be very difficult to find the cause without seeing your project.

Can you attach your project or a reduced project which can reproduce the problem,

so that we can reproduce the problem on our side?

moto

P.S. Please refer to the following discussion about how to attach a project

https://community.cypress.com/t5/PSoC-4-MCU/How-to-attach-a-project-archive-file-to-a-question/m-p/1...

 

0 Likes

Hopefully I did this correctly

0 Likes
MotooTanaka
Level 9
Level 9
Distributor - Marubun (Japan)
First comment on blog Beta tester First comment on KBA

Hi,

Your attachment procedure was perfect!

 

Although it took me a while to figure out what the problem was,

I found the root cause of your problem.

Meantime, I can imagine that if PSoC Creator was supporting C++,

you did not have to have this trouble.

 

In my less than a half century  short programming experience

including a ".c" file has been always a source of problems.

IMHO, we should declare in ".h" and define ".c" and always include ".h"

 

Having written that at least I could make your project "compile-able"

but as I don't have your hardware, I could not test it.

So please test and fix the project at your side.

moto

rbtics
Level 1
Level 1
10 sign-ins 5 replies posted 5 sign-ins

Thank you so much for your help!