The configuration of the old and new NCS version

Hello,

I made a code on NCS1.5.0. The main function is to realize audio encoding and decoding. It runs and tests normally on nRF5340 DK. When I migrated this code to NCS1.7.1, a compilation error occurred. I checked it was a compilation error caused by a configuration item "CONFIG_DEPRECATED_ZEPHYR_INT_TYPES=y" in the prj.conf file. When I commented out this configuration item, the compilation was successful, but the test on the nRF5340 DK found that the audio encoding and decoding functions were abnormal, and the sound could not be restored.

I checked the zephyr documentation, this configuration item "CONFIG_DEPRECATED_ZEPHYR_INT_TYPES" was used in Zephyr 2.4.0, but it was abandoned after Zephyr 2.6.0. From the documentation, I understand that this configuration item is related to the data type used in the code. I don't want to modify the original code too much. It is ideal if the problem can be solved by adding or modifying configuration items. Do you have any good ideas or suggestions? Thanks!

 

Best regards,

Devin

  • Hi,

    There is unfortunately no config to enable the use of the deprecated zephyr int types, so I would recommend modifying the code to use the C99 types.
    Another option could be to re-implement the types yourself. This is what was done with CONFIG_DEPRECATED_ZEPHYR_INT_TYPES:

    typedef signed char         s8_t;
    typedef signed short        s16_t;
    typedef signed int          s32_t;
    typedef signed long long    s64_t;
    
    typedef unsigned char       u8_t;
    typedef unsigned short      u16_t;
    typedef unsigned int        u32_t;
    typedef unsigned long long  u64_t;

Related