I have several questions about 52811

Hello Nordic engineer,

I use SDK15.3.0 and Keil

52811 have ROM 192K and RAM 24K

Questions 1:I'd like to know how much RAM and ROM does softdevice(BLE) occupy?

Questions 2:In SDK example, If a certain example doesn't have "p10056e," how many steps do I need to take to go from p10056 to p10056e?

Is there anything else I might have missed?

Questions 3:If I want to achieve functionality similar to that of "ble_app_uart," but it's necessary to have both center and peripheral roles, I looked at "ble_app_multirole_lesc." In the diagram below, can the highlighted section within the red box be removed?

《peer_manager_init()》I don't need to record the previous connection information. Also, it's not necessarily A connecting to B every time; it could be A connecting to C, or B connecting to A.

《buttons_leds_init(&erase_bonds)》The reason is the same as the peer's.

《hrs_init()》《hrs_c_init()》I don't need Heart Rate Service.

《qwr_init()》Because this feature is not utilized in the "ble_central\ble_app_uart_c" context.

Is my understanding correct?

Thanks

Parents
  • Hi,

    Questions 1:I'd like to know how much RAM and ROM does softdevice(BLE) occupy?

    The amount of ROM (flash) used by the SoftDevice differs for different versions. You can see that in the release notes from each SoftDevice version that is part of the SoftDevice zip and where you find the SoftDevices in the SDK(for instance under components/softdevice/s112/doc for S112). If for instence the size of your SoftDevice is 0x19000 (100 kB), that means that the start address of the application must be 0x19000, as it must start immediately after the SoftDevice. (So your screenshot where the application start address is 0 is not going to work). The RAM usage is a bit more complex and depends on the SoftDevice configuration, and is best found experimentally. See Adjustment of RAM and Flash memory for details.

    Questions 2:In SDK example, If a certain example doesn't have "p10056e," how many steps do I need to take to go from p10056 to p10056e?

    pca10056e projects are for the nRF52840 DK, but emulating nRF52811, mostly meaning that the projects are configured for that device peripherals and memory (see Developing for nRF52811 for details). You can refer to Creating your own emulated project for how to convert a pca10056 project to pca10056e. These projects need further adjustments in order to run on an actual nRF52811, as explained under Transferring the project to nRF52811 hardware.

    Questions 3:If I want to achieve functionality similar to that of "ble_app_uart," but it's necessary to have both center and peripheral roles, I looked at "ble_app_multirole_lesc." In the diagram below, can the highlighted section within the red box be removed?

    You can remove most of these if you don't need them (and remove other code related as well, not jut the init functions). One exception is the qwr module, as that can be usefull (unless you want to handle some events yourself). Generally, this approach makes sense. Pick a example that does most of what you need, and remove everything you don't need, then add your additional stuff.

    One thing though. Are you starting a new project now? If so, I would consider using the nRF Connect SDK instead, which is the SDK that is currently being actively developed. Also, if you want to stick with the nRF5 SDK for some reason, I would consider going for nRF5 SDK 17.1.0, which is the latest and has the most resent bug fixes etc.

  • Hi Einar,

    Thank you for your reply

    I ultimately want to implement 'ble_app_multirole_lesc' + 'UART'.

    Regarding the addition of UART functionality, I will figure it out myself.

    However, due to the 'ble_app_multirole_lesc' consuming approximately 100KB of ROM and 26KB of RAM, which exceeds the capacity of the 52811, could you provide me with some keywords to know which library functions can be deleted, such as 'HRS'?

    Thank you.

  • Hi,

    Generally, you should remove any library and feature you do not need, such as services. You may also be able to save quite a bit of space by using a different crypto library. The default configuration of the sample use oberon for elliptice curve crypto (needed in LESC), but you can use micro_ecc instead by disabling NRF_CRYPTO_BACKEND_OBERON_ENABLED in sdk_config.h and enabling NRF_CRYPTO_BACKEND_MICRO_ECC_ENABLED (see Configuring nrf_crypto frontend and backends).

  • Hi Einar,

    Thank you for your reply

    Can you tell me which folder in Nordic classifies "Services" under?

    What you mentioned, "NRF_CRYPTO_BACKEND_OBERON_ENABLED," is set to 0 in the "ble_app_multirole_lesc" that I'm using, and I haven't made any code modifications yet. This means it's in a disabled state. Another one, "NRF_CRYPTO_BACKEND_MICRO_ECC_ENABLED," is also set to 0. So, do I need to change it to 1 to enable it, right?

    Additional note: When I mentioned that I haven't made any modifications, it means that after extracting the SDK, I'm using the example as it is, without any changes.

    Thank you

  • Hi,

    tony55723 said:
    Can you tell me which folder in Nordic classifies "Services" under?

    I was referring to BLE servics (you mentionned HRS). Generally, remove anything you don't need. Another thing I did not mention but which is imporatnt when it comes to size is logging. Make sure to disable logging by setting NRF_LOG_ENABLED to 0 in your sdk_config.h.

    tony55723 said:
    What you mentioned, "NRF_CRYPTO_BACKEND_OBERON_ENABLED," is set to 0 in the "ble_app_multirole_lesc" that I'm using, and I haven't made any code modifications yet. This means it's in a disabled state. Another one, "NRF_CRYPTO_BACKEND_MICRO_ECC_ENABLED," is also set to 0. So, do I need to change it to 1 to enable it, right?

    I did not notice tha tyou were developing on an nRF52840 (or at least have started with a project for that device). That has CryptoCell, which is a HW accelerator, and in that case it is what will be enabled. That is not present on the nRF52811, so you need to disable that. And as LESC needs some crypto features, you need to enable another backend instead. And the backend that will give you the lowest flash usage is micro-ecc.

  • Hi Einar,

    Thank you for your reply

    Multiple errors occurred after deleting the red box

    Another question, does Crypto seem to be related to Lesc?

Reply Children
  • Hi,

    Yes, LESC requiers nrf_crypto for the Diffie–Hellman key exchange. So it is expected that you get errors when you delete these parts. You should put them back in. You can keep all these files and includes in the project, the only thing you need to change is the configuration in sdk_config.h, where you remove cc310 by setting NRF_CRYPTO_BACKEND_CC310_ENABLED to 0, and enabling alternate backend support for the requiered operations instead. See Configuring nrf_crypto frontend and backends.

    The main crypto configs you would want to enable are:

    • NRF_CRYPTO_BACKEND_MICRO_ECC_ENABLED
    • NRF_CRYPTO_BACKEND_MICRO_ECC_ECC_SECP256R1_ENABLED
    • NRF_CRYPTO_BACKEND_NRF_HW_RNG_ENABLED
    • NRF_CRYPTO_BACKEND_NRF_HW_RNG_MBEDTLS_CTR_DRBG_ENABLED

    I may have forgotten some configs, but you can take a look at some example sdk_config.h files (don't pick one from a project for nRF52840), and look at the build errors to see what is missing.

  • Hi Einar,

    Thank you for your reply

    I made a new copy of the example, which is also considered 'put them back in', right?

    When modifying 'NRF_CRYPT0_BACKEND_CC310ENABLED' to 0, there was still a compilation error. I should have made more modifications, but I am not sure about the direction of the modifications...

    This webpage displays“Unfortunately, the page you've requested no longer exists”...

    The main crypto configs you would want to enable are:

    I would like to ask a question first, why is it 'enable'? Because the chip I need to use is 52811, but due to insufficient capacity, I should need more 'disable'?

  • Hi,

    tony55723 said:
    This webpage displays“Unfortunately, the page you've requested no longer exists”...

    Sorry, I must have copy-pasted the wrong link. The correct is here: https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.sdk5.v15.3.0/lib_crypto_config.html 

    This explains configuration the crypto libraries.

    tony55723 said:
    I would like to ask a question first, why is it 'enable'? Because the chip I need to use is 52811, but due to insufficient capacity, I should need more 'disable'?

    You started off with an example project for nRF52840, which is the "biggest" nRF52 series device, and that included CryptoCell which is a hardware accelerator. So you need to disable CryptoCell in sdk_config.h as it is simply not present on your hardware. However, if you want/need LESC (?), you need crypto libraries for some features as discussed earlier in this thread. If you take a look at the pca10040 example project you will see that it does not use CryptoCell, but rely on other libraries (primarily Oberon). You can do that as well, but you will get a even smaller flash usage if you use micro-ecc. If you disable all crypto related libraries, you will get build errors like those you have here, as that is needed for LESC. That said, if you don't need LESC, you can also remove the crypto libreries.

Related