This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

NRFX_TWIM0_INST_IDX' undeclared and configuration problems

Hi to everyone!

I am working on the SDK 17.0.2 and my project contains nrfx_twim.h functions.

I have a problem to understand the changes that i have to make in the sdk_config.h. I have already read all the posts about these concerns but i found small differences in the sdk_config.h of this SDK that do not let me understand the right updates to make in my case.

Thanks,

polimarte

  • I cant share with you the code through the "insert" function, it gives me an error, maybe because it is too long (4395 lines of code). Anyway it is the sdk_config.h that is used in the nRF5_SDK_17.0.2\examples\ant\ant_broadcast\rx\pca10040\s212\arm5_no_packs by default. I am using this example as a template for my project because i have to send data with ANT eventually in the future.

    Thanks 

    polimarte 

  • polimarte said:
    I cant share with you the code through the "insert" function, it gives me an error, maybe because it is too long (4395 lines of code).

    If you are unable to paste it with the "Insert-> Code" option, perhaps you could try the "Insert-> Image/Video/File" option instead.

    polimarte said:
    Anyway it is the sdk_config.h that is used in the nRF5_SDK_17.0.2\examples\ant\ant_broadcast\rx\pca10040\s212\arm5_no_packs by default. I am using this example as a template for my project because i have to send data with ANT eventually in the future.

    Thank you for clarifying, this makes it a lot easier for me to know what you are working with, great!

    Try adding the following to your sdk_config.h file.

    // </e>
    
    // <e> NRFX_TWIM_ENABLED - nrfx_twim - TWIM peripheral driver
    //==========================================================
    #ifndef NRFX_TWIM_ENABLED
    #define NRFX_TWIM_ENABLED 1
    #endif
    // <q> NRFX_TWIM0_ENABLED  - Enable TWIM0 instance
     
    
    #ifndef NRFX_TWIM0_ENABLED
    #define NRFX_TWIM0_ENABLED 0
    #endif
    
    // <q> NRFX_TWIM1_ENABLED  - Enable TWIM1 instance
     
    
    #ifndef NRFX_TWIM1_ENABLED
    #define NRFX_TWIM1_ENABLED 1
    #endif
    
    // <o> NRFX_TWIM_DEFAULT_CONFIG_FREQUENCY  - Frequency
     
    // <26738688=> 100k 
    // <67108864=> 250k 
    // <104857600=> 400k 
    
    #ifndef NRFX_TWIM_DEFAULT_CONFIG_FREQUENCY
    #define NRFX_TWIM_DEFAULT_CONFIG_FREQUENCY 26738688
    #endif
    
    // <q> NRFX_TWIM_DEFAULT_CONFIG_HOLD_BUS_UNINIT  - Enables bus holding after uninit
     
    
    #ifndef NRFX_TWIM_DEFAULT_CONFIG_HOLD_BUS_UNINIT
    #define NRFX_TWIM_DEFAULT_CONFIG_HOLD_BUS_UNINIT 0
    #endif
    
    // <o> NRFX_TWIM_DEFAULT_CONFIG_IRQ_PRIORITY  - Interrupt priority
     
    // <0=> 0 (highest) 
    // <1=> 1 
    // <2=> 2 
    // <3=> 3 
    // <4=> 4 
    // <5=> 5 
    // <6=> 6 
    // <7=> 7 
    
    #ifndef NRFX_TWIM_DEFAULT_CONFIG_IRQ_PRIORITY
    #define NRFX_TWIM_DEFAULT_CONFIG_IRQ_PRIORITY 6
    #endif
    
    // <e> NRFX_TWIM_CONFIG_LOG_ENABLED - Enables logging in the module.
    //==========================================================
    #ifndef NRFX_TWIM_CONFIG_LOG_ENABLED
    #define NRFX_TWIM_CONFIG_LOG_ENABLED 0
    #endif
    // <o> NRFX_TWIM_CONFIG_LOG_LEVEL  - Default Severity level
     
    // <0=> Off 
    // <1=> Error 
    // <2=> Warning 
    // <3=> Info 
    // <4=> Debug 
    
    #ifndef NRFX_TWIM_CONFIG_LOG_LEVEL
    #define NRFX_TWIM_CONFIG_LOG_LEVEL 3
    #endif
    
    // <o> NRFX_TWIM_CONFIG_INFO_COLOR  - ANSI escape code prefix.
     
    // <0=> Default 
    // <1=> Black 
    // <2=> Red 
    // <3=> Green 
    // <4=> Yellow 
    // <5=> Blue 
    // <6=> Magenta 
    // <7=> Cyan 
    // <8=> White 
    
    #ifndef NRFX_TWIM_CONFIG_INFO_COLOR
    #define NRFX_TWIM_CONFIG_INFO_COLOR 0
    #endif
    
    // <o> NRFX_TWIM_CONFIG_DEBUG_COLOR  - ANSI escape code prefix.
     
    // <0=> Default 
    // <1=> Black 
    // <2=> Red 
    // <3=> Green 
    // <4=> Yellow 
    // <5=> Blue 
    // <6=> Magenta 
    // <7=> Cyan 
    // <8=> White 
    
    #ifndef NRFX_TWIM_CONFIG_DEBUG_COLOR
    #define NRFX_TWIM_CONFIG_DEBUG_COLOR 0
    #endif
    
    // </e>

    Please also make sure that you do not have TWI_ENABLED defined in your sdk_config. To be explicit: It can not be set to 0, it needs to be commented out or removed all together, if you have added it already.

    Try this, and let me know if your original NRFX_TWIM0_INST_IDX undeclared error is resolved.
    If it is not, please try to share the entire sdk_config file again, so I may take a look.

    Looking forward to resolving this issue together!

    Best regards,
    Karl

  • Unfortunately the error is still there. The only TWI_ENABLED in my project are these: 

    My "new" sdk_config is:

    8875.sdk_config.h

    As always, thanks Karl!

    polimarte

  • polimarte said:
    Unfortunately the error is still there. The only TWI_ENABLED in my project are these

    Sorry, it seems that I enabled TWIM1 in the configuration I sent you, and you are creating an instance for TWIM0.
    Please change NRFX_TWIM0_ENABLED to 1, and NRFX_TWIM1_ENABLED to 0, and see if it resolves the error.

    polimarte said:
    As always, thanks Karl!

    It is no problem at all, Polimarte! I hope we will resolve this issue together shortly.

    Best regards,
    Karl

Related