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

How to merge two projects of centrale role in the same applicative code for test-fixture that have each one different settings of IRAM1 (start and size) ?

I develop a test fixture based on nrf51 code that I use for final product.

NRF51 is just a part of a complex test fixture, then I have just "one" test fixture model.

I modifiy product code to run on a test-fixture with UART com added (to computer COM exchange), then central code of test fixture is near the central code of product. (I will have the same for peripheral on an other mode of test-fixture)

The test fixture that test DUT (in peripheral mode) is configured as central mode.

I have several different DUT in peripheral mode that have specific central device (then each DUT need a specific central to test).

In my test-fixture, I have two project to merge with different settings of RAM start and RAM length because project are not configured the same (but it is for the same "global" project that have several device).

I merge source code (with differents name of functions !) and compil one hex.

When I link project, I must set a configuration in IRAM1 memory area (keil studio options for target). I choose the biggest settings of 2 projects (I use 32k RAM chip for each one and then on test bench)

on boot, I check an I/O to select boot mode (I run functions of a project that I need). When test bench change, I reset NRF51 and boot on other functions.

But, when appli start, I have an SDH debug message (warning) that tell me that start and size are not correct for one of project, that is normal because it is not the optimal settings, but because memory is large enough, I think It would be good. But appli stop on fault.

Is there hidden limitation of memory start/size if we do not respect the start/size preconized by function  CHECK_RAM_START_ADDR() ?

Regards

  • Hello,

    The way to usually handle this is to monitor the warning message that you refer to. Try to set the start/size according to the message, and the warning should go away. If you change certain things in your application, such as add a new service, change the number of simultaneous supported connections or similar, you will get the warning message again, because this requires changes in the RAM settings.

    Best regards,

    Edvin

  • Hello,

    Yes of course, for each project I adjust settings of IRAM1 like warning message that I catch. I knonw it and it works fine.

    My question is about merging of two differents projects (IRAM1 differents) in the same HEX binary executable. Source code include functions of the two projets, and I boot on one or the other...

    The adjustment of IRAM1 is just for 1 of the 2 projects (I must choose which one). Then I choose settings of the biggest, but the smallest don't works. I think is about start RAM that is different.

    So in fact, the "warning" is rather an "error" or an "forbidding"... we need to do it and not just be informed...

    I thought that the memory size should be at least minimal (the rest being assumed not to be used), while the start must be respected.

    How to impose the "identical" start to the two projects ?

    Regards,

  • Cedric M said:
    I thought that the memory size should be at least minimal (the rest being assumed not to be used), while the start must be respected.

     Remember that the size is not the actual size of the application. The size that you set in the settings is the "remaining size of the RAM after the softdevice has taken it's chunk". So it is basically the available RAM that the application can use. If I got your question correct. I am not completely sure. 

    So just go with one, check what the log says, and adjust to that. 

     

    Cedric M said:
    The adjustment of IRAM1 is just for 1 of the 2 projects (I must choose which one). Then I choose settings of the biggest, but the smallest don't works. I think is about start RAM that is different.

     I suspect that this may not be the case. Is the issue that your combined application "doesn't work"? What do you mean by that? What happens when you start the application?

    I am not sure I understand what you mean by "merging of two different projects in the same HEX binary executable". Do you open one of the projects, and add functions and files from the other project into this project?

  • #1

    Oh yes thank you ! I did not understand that the configuration consisted of defining the remaining RAM for the application, I thought on the contrary that it was the RAM reserved for Nordic functions.
    This changes everything in terms of understanding, so I must indeed review my configuration

    this must therefore (obviously) encroach on the application RAM, which will explain the fault output.

    #2

    this point follows directly from point # 1. As the definition of memories is not good, this can only lead to a problem.
    For the merger of projects, yes that's what I did (roughly)
    - I modified the 1st project to call all its functions after booting following a selection at boot time,
    - I integrated the second project into the first, again by separating its functions to be able to call it separately
    - the 2 projects have different function names because initially they could have common things.

    During the tests, each branch works well if I apply its configuration of IRAM1, which as I said following your previous remark coincides exactly with my poor understanding of the configuration of the memory reserved for the application and not for the stack nordic

    So I think point # 2 will resolve itself when point # 1 is corrected

    thanks a lot.

    Regards

    CM

Related