error 134 : Expected a field name while intergrating two peripherals SAADC with PMIC -twi sensor .

i have PMIC(I2C based )Max20360  that is developed using twi sensor , to this when i am intergrating a SAADC part throws error error # 134 :expected a field name . 1)why am i getting this error ? 

2) Is there any procedure to combine two or more peripheral Example . like twi + SAADC + SPI 

  • Hello,

    2) Is there any procedure to combine two or more peripheral Example . like twi + SAADC + SPI

    It certainly is. But I don't have a sample doing that at hand right now.

    1)why am i getting this error ?

    This is probably some other error causing this rather cryptic error message.

    If you were to zip the application folder, and upload it here, would I be able to replicate the build error in a fresh unzip of SDK 17.1.0 (or another version that you are using. Please let me know which version you are using). Or did you change something in the driver files (any files outside your application folder)?

    Best regards,

    Edvin

  • 1) twi_sensor_RE_26_6_25_plucGLUCADC.zip 

    i have worked above application on nrfSDK 15.2 version driver file ADC side i have not  modified .

  • 1:

    Your twi_event_handler was missing a "break;" after "default:"

    Also, I changed the line indents for common practice:

    //Event Handler
    void twi_event_handler(nrfx_twim_evt_t const * p_event, void * p_context)
    {
        //Check the event to see what type of event occurred
        switch (p_event->type)
        {
            //If data transmission or receiving is finished
    	case NRFX_TWIM_EVT_DONE:
            switch(p_event->xfer_desc.type)
            {
             case NRFX_TWIM_XFER_TX:
                 twi_tx_done = true;
                 break;
             case NRFX_TWIM_XFER_TXTX:
                 twi_tx_done = true;
                 break;
             case NRFX_TWIM_XFER_RX:
                 twi_rx_done = true;
                 break;
             case NRFX_TWIM_XFER_TXRX:
                 twi_rx_done = true;
                 break;
             default:
                 break;
            }
            break;
        case NRFX_TWIM_EVT_ADDRESS_NACK:
            break;
        case NRFX_TWIM_EVT_DATA_NACK :
            break;
        default :
            break;
              
        }
    }

    2: Your uint8_t PMIC_PowerUP_Seq(void) doesn't return any value. Add return NRF_SUCCESS; or change function type to void.

    3: In PFN1_PMIC_Config(), nrf_gpio_cfg_input() expects the pull parameter to be "nrf_gpio_pin_pull_t pull_config", so use "NRF_GPIO_PIN_PULLUP" instead of "GPIO_PIN_CNF_PULL_Pullup".

    4: Your function declarations can't be empty, like these in max20360.h:

    float Get_Cell_Voltage();
    float Get_SOC();
    
    //Replace with:
    
    float Get_Cell_Voltage(void);
    float Get_SOC(void);

    Now, the final thing, the one causing the error 134 issues.

    I did not get to the bottom of this. But I noticed that if I moved the inclusion of #include "max20360.h" further up, then the files it was before started throwing the same errors. Similarly, if max20360.h is the last file that is included in main.c, the errors go away.

    So there is some syntax error in your max20360.h, but I couldn't figure out what it is. You need to go through it and look for issues. You can try to include it in a project that doesn't use it, and see if it fails to build there as well. (The issue is that if I remove it from your project, the project will not build, because it is depending on that file). If you can build without it, try including it (before some other header files), and try to comment out parts of the max20360.h until it starts building again. Then look into what line(s) that are causing the issue.

    After moving the file to the bottom, I just needed to include a couple of .c files to your project for it to build:

    nrfx_ppi.c, nrfx_timer.c and nrf_drv_ppi.c, I believe it was.

    Best regards,

    Edvin

  • Oh, I tried just that. It is the defines from your max20360.h. Particularly:

    #define STATUS           0x00
    #define CONFIG           0x1D

    They are conflicting with existing register names.

    Best regards,

    Edvin

Related