Application build problems ADuCM3029_demo_cn0414 using ADICUP3029

I am simply trying to build the ADuCM3029_demo_cn0414 in CCES 2.8.0.0, as it currently exists.  I'm new to the CCES environment, and have not modified any of the code to reflect my particular application.  I had lots of problems with unresolvable, and conflicting variables as I tried to get the thing to build.  The problem was endemic to all of the projects that were installed into the IDE.  It looked like something major was missing somewhere.

Depending on which CMSIS pack or combination of packs was installed, the unresolvable variables problem seemed to change somewhat.  I found and installed the CMSIS development pack 5.7.1 -dev0, and that seemed to fix the unresolvable variables problem.  That made me feel good, but other problems became visible, now related to the RTE.

I found one EZ article from someone who was having problems getting blink to work because of conflicting variables in the RTE file startup_ADuCM3029.c .  The ADI engineer suggested commenting out the four linker related external variables that were causing the conflict; done.  That allowed another problem to become visible, .../RTE/Device/ADuCM3029/system_ADuCM3029.c:378:31: error: 'NVIC_INTS' undeclared (first use in this function).

I don't know how to get this thing to work.  Am I going to keep exposing more problems as I go along?  What am I missing?  Do I need to rollback CCES to 2.6.0.0?  Please help.

Thanks,

Allan

Parents
  • 0
    •  Analog Employees 
    on Jan 19, 2021 8:01 AM

    Hello,

    There should be no more problems after commenting lines in system_ADuCM3029.c that refer to the already defined variables. I would suggest trying with CCES 2.9.1 or higher and ARM.CMSIS 5.6.0 first. Do you still encouter problems like this?

    Regards,
    Andrei

  • Andrei,

    Thank you for your reply.  I think the problem with my project may be a bit more complex than you and I think. 

    I started using CCES 2.9.3.0.  I commented out the other issues, but using CCES 2.9.3.0 caused other problems to show up.  It looks like the GPIO driver and possibly other drivers for other elements of the project/processor combinations is messed up in CCES 2.9.3.0, and I think the problem crosses multiple projects for the ADuCM3029.  I didn't see this type of problem in CCES 2.8.0.0, once I got the right CMSIS pack combination installed.  I can't figure out how to get the GPIO variables to resolve in the CCES 2.9.3.0. 

    Maybe it's buried somewhere in the CMSIS packs or elsewhere, but I can't tell where.  There must be some sort of combinations of the CCES CMSIS packs or system RTE configuration that needs to be enabled to get it to work.

    In CCES 2.8.0.0, I do not have the unresolved variables problem.  Instead, I get the following error message (Additional CRLF added to make the lines more readable) as the final build message output after building project ADuCM3029_demo_cn0414:

    'Building target: ADuCM3029_demo_cn0414'


    'Invoking: CrossCore GCC ARM Embedded C Linker'


    arm-none-eabi-gcc -T"C:\Analog Devices\CrossCore Embedded Studio 2.8.0\ADICUP3029 Workspace\EVAL-ADICUP3029-master.zip_expanded\EVAL-ADICUP3029-master\projects\ADuCM3029_demo_cn0414/RTE/Device/ADuCM3029/ADuCM3029.ld" -Wl,--gc-sections -mcpu=cortex-m3 -mthumb -specs=nosys.specs _RTE_ __ADUCM3029__ __SILICON_REVISION__=0x102 "C:/Analog Devices/CrossCore Embedded Studio 2.8.0/ARM/packs/ARM/CMSIS/5.7.1-dev0/CMSIS/Core/Include" "C:/Analog Devices/CrossCore Embedded Studio 2.8.0/ARM/packs/ARM/CMSIS/5.7.1-dev0/CMSIS/Driver/Include" "C:/Analog Devices/CrossCore Embedded Studio 2.8.0/ARM/packs/ARM/CMSIS/5.7.1-dev0/CMSIS/Driver/VIO/Include" "C:/Analog Devices/CrossCore Embedded Studio 2.8.0/ARM/packs/AnalogDevices/ADI-BleSoftware/1.0.1/Include/communication" "C:/Analog Devices/CrossCore Embedded Studio 2.8.0/ARM/packs/AnalogDevices/ADI-BleSoftware/1.0.1/Include/communication/ble" "C:/Analog Devices/CrossCore Embedded Studio 2.8.0/ARM/packs/AnalogDevices/ADuCM302x_DFP/3.1.0/Include" "C:/Analog Devices/CrossCore Embedded Studio 2.8.0/ARM/packs/AnalogDevices/ADuCM302x_DFP/3.1.0/Include/drivers/adc" "C:/Analog Devices/CrossCore Embedded Studio 2.8.0/ARM/packs/AnalogDevices/ADuCM302x_DFP/3.1.0/Include/drivers/beep" "C:/Analog Devices/CrossCore Embedded Studio 2.8.0/ARM/packs/AnalogDevices/ADuCM302x_DFP/3.1.0/Include/drivers/crc" "C:/Analog Devices/CrossCore Embedded Studio 2.8.0/ARM/packs/AnalogDevices/ADuCM302x_DFP/3.1.0/Include/drivers/dma" "C:/Analog Devices/CrossCore Embedded Studio 2.8.0/ARM/packs/AnalogDevices/ADuCM302x_DFP/3.1.0/Include/drivers/flash" "C:/Analog Devices/CrossCore Embedded Studio 2.8.0/ARM/packs/AnalogDevices/ADuCM302x_DFP/3.1.0/Include/drivers/gpio" "C:/Analog Devices/CrossCore Embedded Studio 2.8.0/ARM/packs/AnalogDevices/ADuCM302x_DFP/3.1.0/Include/drivers/i2c" "C:/Analog Devices/CrossCore Embedded Studio 2.8.0/ARM/packs/AnalogDevices/ADuCM302x_DFP/3.1.0/Include/drivers/pwr" "C:/Analog Devices/CrossCore Embedded Studio 2.8.0/ARM/packs/AnalogDevices/ADuCM302x_DFP/3.1.0/Include/drivers/rng" "C:/Analog Devices/CrossCore Embedded Studio 2.8.0/ARM/packs/AnalogDevices/ADuCM302x_DFP/3.1.0/Include/drivers/rtc" "C:/Analog Devices/CrossCore Embedded Studio 2.8.0/ARM/packs/AnalogDevices/ADuCM302x_DFP/3.1.0/Include/drivers/spi" "C:/Analog Devices/CrossCore Embedded Studio 2.8.0/ARM/packs/AnalogDevices/ADuCM302x_DFP/3.1.0/Include/drivers/sport" "C:/Analog Devices/CrossCore Embedded Studio 2.8.0/ARM/packs/AnalogDevices/ADuCM302x_DFP/3.1.0/Include/drivers/tmr" "C:/Analog Devices/CrossCore Embedded Studio 2.8.0/ARM/packs/AnalogDevices/ADuCM302x_DFP/3.1.0/Include/drivers/uart" "C:/Analog Devices/CrossCore Embedded Studio 2.8.0/ARM/packs/AnalogDevices/ADuCM302x_DFP/3.1.0/Include/drivers/wdt" "C:/Analog Devices/CrossCore Embedded Studio 2.8.0/ARM/packs/AnalogDevices/ADuCM302x_DFP/3.1.0/Include/drivers/xint" "C:/Analog Devices/CrossCore Embedded Studio 2.8.0/ARM/packs/AnalogDevices/EV-COG-AD3029LZ_BSP/3.1.0/Include" "C:\Analog Devices\CrossCore Embedded Studio 2.8.0\ADICUP3029 Workspace\EVAL-ADICUP3029-master.zip_expanded\EVAL-ADICUP3029-master\projects\ADuCM3029_demo_cn0414/RTE" "C:\Analog Devices\CrossCore Embedded Studio 2.8.0\ADICUP3029 Workspace\EVAL-ADICUP3029-master.zip_expanded\EVAL-ADICUP3029-master\projects\ADuCM3029_demo_cn0414/RTE/BLE" "C:\Analog Devices\CrossCore Embedded Studio 2.8.0\ADICUP3029 Workspace\EVAL-ADICUP3029-master.zip_expanded\EVAL-ADICUP3029-master\projects\ADuCM3029_demo_cn0414/RTE/Device/ADuCM3029" -o  "ADuCM3029_demo_cn0414" @input-file.txt -lm


    arm-none-eabi-gcc: error: _RTE_: No such file or directory


    arm-none-eabi-gcc: error: __ADUCM3029__: No such file or directory


    arm-none-eabi-gcc: error: __SILICON_REVISION__=0x102: No such file or directory


    make: *** [ADuCM3029_demo_cn0414] Error 1\

    It looks like _RTE_, __ADUCM3029__, and __SILICON_REVISION__ are variables of some sort, and the errors associated with them seem to indicate that they are somehow referred to in file names or directories.  Maybe this is an unfortunate compiler mislabeling of the problem, but I cannot tell.  These variables are defined in the .cproject file in the main project directory, and are referred to multiple times in the file. 

    Unfortunately, this whole thing is a bit tricky to use, because of all of the things that have to be unpacked, installed, and enabled.  This looks like some sort of set-up problem, but I cannot tell what I am missing in the set-up.  Therefore, I don't know how to resolve this problem.  The project will not completely compile, and as such, I cannot get the project off ground zero.

    There is another error in the ADuCM3029_demo_cn0414/RTE/Device/ADuCM3029/adi_adc.c file that is flagged as a self reference that maybe should be defined in another way, but I did not write the code.

              /* Clear the status bits */
              pDevice->pReg->STAT =  pDevice->pReg->STAT;

    Apparently, this shows up in two places, only in the adi_adc.c file in the ADuCM3029_demo_cn0414 project.  I do not know what the compiler does when it finds such a statement.  However, this problem did not stop the project build.  In fact, you have to search the project to find it.

    Please help.

    Thanks,

    Allan

  • 0
    •  Analog Employees 
    on Mar 1, 2021 3:28 PM in reply to andreid1994

    Quick update: the pull request I linked in the previous reply has been merged to master, so to get the update just pull master and build the project once again.

    This wiki should guide on importing a project from git to crosscore and building it.

    Regards,
    Andrei

  • Hi Andrei,

    Was the new SPI framework folded into the latest project version?

    Thanks,

    Allan

  • Hello Andrei,

    I am working on a similar issue, if I were to change the code below 

    /* AD4111 usage of SPI parameters. */
    ad4111_ini.spi_init.chip_select = 0xFF;
    ad4111_ini.spi_init.id = 0;
    ad4111_ini.spi_init.max_speed_hz = 4000000;
    ad4111_ini.spi_init.mode = SPI_MODE_3;
    ad4111_ini.spi_init.type = SPI_ARDUINO;
    ad4111_ini.regs = ad4111_regs;
    ad4111_ini.num_reg

    To 

    /* AD4111 usage of SPI parameters. */
    ad4111_ini.spi_init.chip_select = 0xFF;
    ad4111_ini.spi_init.id = 0;
    ad4111_ini.spi_init.max_speed_hz = 4000000;
    ad4111_ini.spi_init.mode = SPI_MODE_3;
    ad4111_ini.spi_init.type = SPI_PMOD;
    ad4111_ini.regs = ad4111_regs;
    ad4111_ini.num_reg

    would this change the actual communication of the ad4111 to the PMOD SPI?

    I ask because as Allan above was referencing, within the platform_drive.h the implementation of the spi_init_param data structure for the type of SPI is this

    typedef struct spi_init_param {
    enum spi_type type;
    uint32_t id;
    uint32_t max_speed_hz;
    enum spi_mode mode;
    uint8_t chip_select;
    } spi_init_pa

    where type is of enumeration spi_type not  en_spi_chan which contains the actual Arduino type connectors and the variable that I initially wanted to change to.

    typedef enum en_spi_channel {
    SPI_ARDUINO, /* SPI0 - used for ARDUINO connector on ADICUP3029 board */
    SPI_PMOD, /* SPI1 - used for PMOD connector on ADICUP3029 board */
    SPI_BLE /* SPI2 - used to send BLE commands to EM9304 */
    } en_spi_channel;

    Does the spi_init_param need to have the type enumeration changed to accommodate for this change? As in 

    typedef struct spi_init_param {
    enum en_spi_channel type;
    uint32_t id;
    uint32_t max_speed_hz;
    enum spi_mode mode;
    uint8_t chip_select;
    } spi_init_param;

    Also, how come there is also a description structure created along with many of these initialization parameters? I.E.

    typedef struct spi_desc {
    enum en_spi_channel type;
    uint32_t id;
    uint32_t max_speed_hz;
    enum spi_mode mode;
    struct gpio_desc *chip_select;
    } spi_desc;

    Thanks,
    Aleks

  • 0
    •  Analog Employees 
    on Apr 15, 2021 10:36 AM in reply to ahaas@hgiworld.com

    Hello Allan,

    Unfortunately no. It was not yet.

    Regards,
    Andrei

  • 0
    •  Analog Employees 
    on Apr 15, 2021 10:48 AM in reply to Aleks89

    Hello Aleks,

    That change is good, but it is not enough. You need 2 more things:

    1. You also need to change ad4111_ini.spi_init.id = 1; (from ad4111_ini.spi_init.id = 0;). This is because the ADICUP3029 has 3 SPI controllers and the Arduino header has SPI0 while the PMOD has SPI1. More information here.

    2. You need to go into the Pin multiplexing tab in system.svc and enable the SPI1 necessary pins for the bus. You should do this using CrossCore. This picture should help:

    Regards,
    Andrei

Reply
  • 0
    •  Analog Employees 
    on Apr 15, 2021 10:48 AM in reply to Aleks89

    Hello Aleks,

    That change is good, but it is not enough. You need 2 more things:

    1. You also need to change ad4111_ini.spi_init.id = 1; (from ad4111_ini.spi_init.id = 0;). This is because the ADICUP3029 has 3 SPI controllers and the Arduino header has SPI0 while the PMOD has SPI1. More information here.

    2. You need to go into the Pin multiplexing tab in system.svc and enable the SPI1 necessary pins for the bus. You should do this using CrossCore. This picture should help:

    Regards,
    Andrei

Children
No Data