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

sdk_config.h suggestions

Perhaps the following defines added to the beginning would make user specifications a little clearer

#define  Default    0

#define  Black      1

#define  Red        2

#define  Green      3

#define  Yellow     4

#define  Blue       5

#define  Magenta    6

#define  Cyan       7

#define  White      8

#define Off     0

#define Error   1

#define Warning 2

#define Info    3

#define Debug   4

#define   baud_1200     323584

#define   baud_2400     643072

#define   baud_4800   1290240

#define   baud_9600   2576384

#define  baud_14400   3862528

#define  baud_19200   5152768

#define  baud_28800   7716864

#define  baud_38400  10289152

#define  baud_57600  15400960

#define  baud_76800  20615168

#define baud_115200  30801920

#define baud_230400  61865984

#define baud_250000  67108864

#define baud_460800 121634816

#define baud_921600 251658240

//#define baud_57600  268435456 why would you use this?

Permitting user defines:

#define NRF_LOG_DEFAULT_LEVEL Info

#define NRF_LOG_ERROR_COLOR  Default

#define NRF_LOG_BACKEND_SERIAL_UART_BAUDRATE baud_115200

similar for

TIMER_DEFAULT_CONFIG_FREQUENCY

COMP_CONFIG_REF,COMP_CONFIG_MAIN_MODE,  COMP_CONFIG_SPEED_MODE, COMP_CONFIG_HYST, COMP_CONFIG_ISOURCE

xxx_CONFIG_IRQ_PRIORITY PRIORITY_7   // not defining PRIORITY_0

not defining PRIORITY_2 for nRF51 and 

not defining PRIORITY_1,4,5 for nRF52

and others

Thank you for your consideration.

Parents
  • Hi,

    I'm not sure I understand why you would want these defines. Is it to make it easier for users to set the correct define?

    The sdk_config.h file follow the CMSIS configuration wizard annotations, the options are given above each setting:

    // <o> NRF_LOG_DEFAULT_LEVEL  - Default Severity level
     
    // <0=> Off 
    // <1=> Error 
    // <2=> Warning 
    // <3=> Info 
    // <4=> Debug 
    
    #ifndef NRF_LOG_DEFAULT_LEVEL
    #define NRF_LOG_DEFAULT_LEVEL 3
    #endif

    If you use Keil Configuration Wizard or CMSIS Configuration Wizard, the GUI will show you the options and you can select the desired option from a dropdown menu.

    Best regards,
    Jørgen

  • Now I understand all that comment structure, it's not for programing wizards, it's for the wizard programs! 
    I didn't (and I would wonder how many others) know about the wizards.
    Thanks for the information on these.

    I didn't want to establish an entire configuration.
    All I wanted to do was set the LOG level to INFO.
    With a  sdk_config_begin.h I described all I need to add to my source is:

    #define NRF_LOG_DEFAULT_LEVEL Info

    Of course later I will want to comment out this (perhaps to enable it again later!)

    Easy and clear. No mysteries, or wizards!

    Many of the items in sdk_config.h are very low level internals and slight (incorrect) changes can have catastrophic consequences.
    Other items like LOG level, color, baud rate, are "external"  and application programmer configurations.

    Needing to install, yet another, tool is unnecessarily complicated. Also using the GUI makes tracking changes difficult.

Reply
  • Now I understand all that comment structure, it's not for programing wizards, it's for the wizard programs! 
    I didn't (and I would wonder how many others) know about the wizards.
    Thanks for the information on these.

    I didn't want to establish an entire configuration.
    All I wanted to do was set the LOG level to INFO.
    With a  sdk_config_begin.h I described all I need to add to my source is:

    #define NRF_LOG_DEFAULT_LEVEL Info

    Of course later I will want to comment out this (perhaps to enable it again later!)

    Easy and clear. No mysteries, or wizards!

    Many of the items in sdk_config.h are very low level internals and slight (incorrect) changes can have catastrophic consequences.
    Other items like LOG level, color, baud rate, are "external"  and application programmer configurations.

    Needing to install, yet another, tool is unnecessarily complicated. Also using the GUI makes tracking changes difficult.

Children
No Data
Related