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

Brand new to microcontroller programming, cortex, and Nrf - how to come up to speed?

I have been slogging my way through documentation and examples and have managed to create a beacon application using the development kit and Segger IDE.  That said I am fumbling around because I do not possess the fundamentals.  I am very willing to read a book or many books or take some online courses to learn all this but I don't know where to find it or what is the best process.  I have looked for books and tutorials but don't think I have come across any methodical approaches.  Anybody have ideas on how to do this?

Parents
  • Hi,

    If you know basic C programming and just need a primer for Embedded systems, then Making Embedded Systems might be a good starting point. If you don't have experience with C programming you should learn the basics of it first, for instance from K&R's The C Programming Language. This will give you a basic understanding of the fundamentals needed for embedded software development in general.

  • Appreciate the reply.  I need to be more specific.  C programming check.  Making embedded systems check.  My struggles come from things like: 

    I am running with multiple event timers which create a multi-threaded operation.  Initiating sleep mode does the system wait for all processes to complete before going to sleep?  

    I want to transmit a packet using an event timer.  When I wake up will a packet get sent immediately?  

    How long do I have to leave the process open to assure the packet got sent before going back to sleep?

    There are a large number of init values and a number of functions that must be executed in order to set up advertising correctly.  I got advertising running by example but don't really understand what I did.  I do Internet searches for function names and almost always wind up on a forum site where a person is having trouble with some aspect of the function.  I don't seem to ever find a tutorial or documentation the explains the function in any meaningful way.

    I wanted to put the system into broadcast mode.  I searched everywhere for a setting for broadcast but never found any.  I set up broadcasting for unidirectional, non-connect, non-directed.  I am assuming that this is the same as broadcaster.

    These are examples of the kind of things I run into that I then research for sometimes hours.  It seems to work but a more efficient way would be to truly understand the Cortex M40, the nordic softdevice, and ble.

    I hope that explains it better and look forward to any insights you may have.

    Thanks!

  • Hi,
    mark waldin said:
    Appreciate the reply.  I need to be more specific.  C programming check.
    That is good 
    mark waldin said:
    I am running with multiple event timers which create a multi-threaded operation.  Initiating sleep mode does the system wait for all processes to complete before going to sleep?  
    If you are using the nRF5 SDK examples, which are bare meatal and not using an RTOS, this is more or less what you see. If you go to sleep (system on idle), typically by calling sd_app_evt_wait() (which in turn calls WFE()), then that will put the system in sleep right away, and it will wake up on any event/interrupt. Most SDK examples handle this by calling sd_app_evt_wait() in the main loop so that it will always go to sleep after processing any interrupts and doing one iteration of the main loop.
    mark waldin said:
    I want to transmit a packet using an event timer.  When I wake up will a packet get sent immediately?
    Typically not. Are you using BLE? If so, then you will "send" the packet to the stack, which will queue it and transmit it on air in the next connection event.
    mark waldin said:
    How long do I have to leave the process open to assure the packet got sent before going back to sleep?
    You go back to sleep immediately. The SoftDevice (BLE stack) is completely event-driven. If you don't use BLE, that typically applies to other protocol stacks as well, as being event-driven and spending no (or very little) time busy waiting is important in order to achieve low power.
    mark waldin said:
    There are a large number of init values and a number of functions that must be executed in order to set up advertising correctly.  I got advertising running by example but don't really understand what I did.  I do Internet searches for function names and almost always wind up on a forum site where a person is having trouble with some aspect of the function.  I don't seem to ever find a tutorial or documentation the explains the function in any meaningful way.
    The SDK is quite complex and you should not expect to understand everything, particularly not in the beginning. I recomend you start with examples as you do, and refer to the SDK documentation on Infocenter as needed.
    mark waldin said:
    I wanted to put the system into broadcast mode.  I searched everywhere for a setting for broadcast but never found any.  I set up broadcasting for unidirectional, non-connect, non-directed.  I am assuming that this is the same as broadcaster.
    A broadcaster is essentially a non-connectable advertiser. The simplest example of that is the Beacon Transmitter Sample Application.
    mark waldin said:
    These are examples of the kind of things I run into that I then research for sometimes hours.  It seems to work but a more efficient way would be to truly understand the Cortex M40, the nordic softdevice, and ble.
    You typically don't need detailed knowledge about Cortex-M architecture, though it could come in handy sometimes. However, if you are making a BLE product you should definitely have a basic understanding of BLE. You should also have knowledge about the SoftDevice and SDK, which you can find on infocenter. In addition to the SDK documentation, it also has the SoftDevice specification.
Reply
  • Hi,
    mark waldin said:
    Appreciate the reply.  I need to be more specific.  C programming check.
    That is good 
    mark waldin said:
    I am running with multiple event timers which create a multi-threaded operation.  Initiating sleep mode does the system wait for all processes to complete before going to sleep?  
    If you are using the nRF5 SDK examples, which are bare meatal and not using an RTOS, this is more or less what you see. If you go to sleep (system on idle), typically by calling sd_app_evt_wait() (which in turn calls WFE()), then that will put the system in sleep right away, and it will wake up on any event/interrupt. Most SDK examples handle this by calling sd_app_evt_wait() in the main loop so that it will always go to sleep after processing any interrupts and doing one iteration of the main loop.
    mark waldin said:
    I want to transmit a packet using an event timer.  When I wake up will a packet get sent immediately?
    Typically not. Are you using BLE? If so, then you will "send" the packet to the stack, which will queue it and transmit it on air in the next connection event.
    mark waldin said:
    How long do I have to leave the process open to assure the packet got sent before going back to sleep?
    You go back to sleep immediately. The SoftDevice (BLE stack) is completely event-driven. If you don't use BLE, that typically applies to other protocol stacks as well, as being event-driven and spending no (or very little) time busy waiting is important in order to achieve low power.
    mark waldin said:
    There are a large number of init values and a number of functions that must be executed in order to set up advertising correctly.  I got advertising running by example but don't really understand what I did.  I do Internet searches for function names and almost always wind up on a forum site where a person is having trouble with some aspect of the function.  I don't seem to ever find a tutorial or documentation the explains the function in any meaningful way.
    The SDK is quite complex and you should not expect to understand everything, particularly not in the beginning. I recomend you start with examples as you do, and refer to the SDK documentation on Infocenter as needed.
    mark waldin said:
    I wanted to put the system into broadcast mode.  I searched everywhere for a setting for broadcast but never found any.  I set up broadcasting for unidirectional, non-connect, non-directed.  I am assuming that this is the same as broadcaster.
    A broadcaster is essentially a non-connectable advertiser. The simplest example of that is the Beacon Transmitter Sample Application.
    mark waldin said:
    These are examples of the kind of things I run into that I then research for sometimes hours.  It seems to work but a more efficient way would be to truly understand the Cortex M40, the nordic softdevice, and ble.
    You typically don't need detailed knowledge about Cortex-M architecture, though it could come in handy sometimes. However, if you are making a BLE product you should definitely have a basic understanding of BLE. You should also have knowledge about the SoftDevice and SDK, which you can find on infocenter. In addition to the SDK documentation, it also has the SoftDevice specification.
Children
No Data
Related