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

Parents
  • Hello Polimarte,

    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.

    Please elaborate, what small differences have you noticed in the sdk_config? Do you mean, different from previous versions of the nRF5 SDK?

    You might be seeing an artifact of the appy_old_config file, which is included in all sdk examples. This file is there to provide backwards compatibility, but its inclusion is perhaps not the most intuitive.
    Please take a look at this and this ticket, to see if it may be similar to the problems you are currently experiencing.

    Best regards,
    Karl

  • HI, sorry but i cannot understand. that's my fault because i am new to this architecture and i am in seriuos trouble with my project.

    For example the first post is referring to set PPI_ENABLED 0 and NRFX_PPI_ENABLED 1. where i can find this macros? i have to add them up manually to the sdk_config.h? i have done it but in apply_old_config there is no change at all.

    what am i missing?

    The second post suggest to define a custum sdk_config.h. The logic to follow is very different from the previous post that you sent me. 

    thanks,

    polimarte

  • Hi Karl, in the last period we meet a lot online!

    Could you elaborate on what you meant when you said that you found small differences in the sdk_config, like you said in your original ticket?

    I mean that possible solution were referred to older version of SDK and some macros of sdk_config.h are different.

    f you are using Segger Embedded Studios ( SES )

    I am using keil.

    My SDK is the 17.0.2 and my problem is the undefinition of "NRFX_TWIM0_INST_IDX".

    that should be defined in apply_old_config: 

    Am i right?

    in my sdk_config.h i dont find the TWI_ENABLED macro. should i add it manually? i try to that but nothing changed.

    Where i should define TWI_PRESENT and TWIM_PRESENT?

    polimarte

  • polimarte said:
    in the last period we meet a lot online!

    Hehe, yes, it seems we do, Polimarte!

    polimarte said:
    I am using keil.

    I am not too familiar with Keil personally, but I would think that they have an equal function in their IDE. You could try the same hotkey, or look for the "Search Solution" option and its hotkeys in the bar atop the program window.

    polimarte said:

    I am using keil.

    My SDK is the 17.0.2 and my problem is the undefinition of "NRFX_TWIM0_INST_IDX".

    polimarte said:
    that should be defined in apply_old_config: 

    Could you instead share the contents of your sdk_config file? It is hard to understand what is going on by looking at a screenshot.

    polimarte said:

    in my sdk_config.h i dont find the TWI_ENABLED macro. should i add it manually? i try to that but nothing changed.

    Where i should define TWI_PRESENT and TWIM_PRESENT?

    TWIM_PRESENT will be set when NRFX_TWIM_ENABLED + NRFX_TWIM*_ENABLED is set.
    This will be a lot easier to have a look at if you could share your entire sdk_config file.

    Best regards,
    Karl

  • 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

Reply Children
Related