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

Beginner needing help with basic structure and pwm

I am a complete beginner, working through the tutorials and trying not to ask basic questions. However, I am up against a customer time limit and need some help. I am trying to create a program similar to nrf Blinky and soft LED. I need remote on/off and a 0 to 100% control of a 1KHz pwm signal that I can select on an app, and the device will follow. Think of as remote dimming control. I'm using the Murata WSM-BL241-ADA-008 MBN52832 and laid out my pcb to match the Muarata dev board connections. I've downloaded S132 and the Blinky example to my design and the board is alive and functioning as expected. So basically now I need some guidance on where to start adding advertising, the service, the raw data etc for pwm functionality to my version of Blinky. Thank you!

Parents Reply Children
  • Thanks for the link. I did see that earlier and have been working my way through it however I am getting an error when trying to compile the code.

    L6050U: The code size of this image (34532 bytes) exceeds the maximum allowed for this version of the linker.

    Apparently I'm using MDK-Lite which I downloaded via a link in the SDK.

  • Keil is ARM privative, both IDE and compiler. Try using some GCC based environment, you can use the licensed by Nordic SEGGER which is free for you to use commercially, or any GCC flavour, pure Makefiles or Eclipse.

    All examples are availaible as GCC projects, and Segger projects.

    At the end you will be glad to start GCCing yourself, some Keil features are kinda dark.

  • I'll definitely look in to GCC.

    So right now I have fixed a few things but I cant get it to compile. The error code is:

    ..\..\..\main.c(380): warning:  #223-D: function "ble_cus_init" declared implicitly
         err_code = ble_cus_init(&m_cus, &cus_init);

    This is the code the error is referring to:

    static void services_init(void)
    {
        /* YOUR_JOB: Add code to initialize the services used by the application.
           ret_code_t                         err_code;
           ble_xxs_init_t                     xxs_init;
           ble_yys_init_t                     yys_init;

           // Initialize XXX Service.
           memset(&xxs_init, 0, sizeof(xxs_init));

           xxs_init.evt_handler                = NULL;
           xxs_init.is_xxx_notify_supported    = true;
           xxs_init.ble_xx_initial_value.level = 100;

           err_code = ble_bas_init(&m_xxs, &xxs_init);
           APP_ERROR_CHECK(err_code);

           // Initialize YYY Service.
           memset(&yys_init, 0, sizeof(yys_init));
           yys_init.evt_handler                  = on_yys_evt;
           yys_init.ble_yy_initial_value.counter = 0;

           err_code = ble_yy_service_init(&yys_init, &yy_init);
           APP_ERROR_CHECK(err_code);
         */
       ret_code_t                         err_code;
       ble_cus_init_t                     cus_init;
       
       
       memset(&cus_init, 0, sizeof(cus_init));
       
       err_code = ble_cus_init(&m_cus, &cus_init);
       APP_ERROR_CHECK(err_code);

       }

    Its copied from the tutorial so I'm not sure what is going on.

  • See this link for an explanation of what an implicit declaration is. Did you remember to include ble_cus.h in your main.c file (i.e. #include "ble_cus.h")? Which step have you reached in the tutorial when you get this error? I can recommend reading through the tutorial again & make sure you haven't missed a small line of code somewhere.

    You can also compare your code with the solution code found here if that is easier (open the ble_cus.c, ble_cus.h and/or main.c files from the top of the tutorial link).

    Also, regarding using Segger, I can highly recommend Segger Embedded Studio. Like mentioned above, it is free for Nordic SDK users (here is a youtube playlist for getting started). I cannot recommend using Eclipse unfortunately, as there are quite a few bugs. I have talked to a few customers & most of them complain that it takes a lot of time to get eclipse working. It is in my honest opinion easier to start with segger embedded studio.

  • I did include ble_cus.h.

    Additionally, I used the tutorial version of main.c and got the same error.

    I am at the first compile stage.

    I just tried using the example files in my project and get 2 errors:

    .\_build\nrf52832_xxaa.axf: Error: L6218E: Undefined symbol ble_cus_init (referred from main.o).
    .\_build\nrf52832_xxaa.axf: Error: L6218E: Undefined symbol ble_cus_on_ble_evt (referred from main.o).
    Not enough information to list image symbols.
    Not enough information to list load addresses in the image map.
    Finished: 2 information, 0 warning and 2 error messages.
    ".\_build\nrf52832_xxaa.axf" - 2 Error(s), 0 Warning(s).

    I tried compiling the example project and got lots of errors. Seems the include paths are wrong for many files, and some files are missing.

    I noticed that in your example that ble_cus.c appears in a folder called nRF_Services but this is not created in my version.

    This is so frustrating! Slight smile All I want to do is switch on and off an io pin and create a variable pwm signal! Arrggh.

Related