• First video presentation

    dumitru.stama12/11/2016 at 02:57 1 comment

    I finally managed to upload a video in which I talk a little bit about what an RTOS is and then I step through the code to show you the big building blocks.

    I will try to upload some technical presentations as well soon.

    Here is the youtube link :

  • Stack layout (revisited)

    dumitru.stama12/03/2016 at 15:45 0 comments

    I realised I made a mistake with the last diagram and used MSP for indexing instead of PSP.

    I corrected the image and re-uploaded to this project.

    Here it is as well :

  • CALL and RET

    dumitru.stama12/03/2016 at 07:24 0 comments

    A few people asked me why I defined these two macros in the assembly source file.

    There is nothing wrong with "bl subroutine" or "bx lr" but these two macros help me read the code faster when I look for specific subroutines.

    I call it "professional defect" since most of the days I stare at Intel assembly and I am used to mentally separate code blocks in a specific way.

  • Task Stack

    dumitru.stama12/03/2016 at 06:44 0 comments

    Here is how a task's stack looks like when the scheduler activates :

    First part (top 8 registers in the diagram) is automatically saved by the interrupt handler, the remaining 8 registers are saved by the following code :

    stmia r1!,{r4-r7}  // store r4-r7 and increment r1 for each one
    mov r2,r8          // r2, r3, r4 and r5 are already saved
    mov r3,r9          // so we can use them as intermediary regs
    mov r4,r10
    mov r5,r11
    stmia r1!,{r2-r5}  // registers are in order on stack r4...r11

  • Rock-solid functionality

    dumitru.stama12/03/2016 at 05:53 0 comments

    I used to get random faults from time to time and these things are quite hard to debug. After a lot of hours I managed to finally isolated the issue in the mutex handling system.

    I redesigned the system, it's much more robust now and it didn't fail yet like the old system.

    Good part: I have 32 max mutexes now since I store them as bits into a word

    Bad part: I had to remove the string from the code :) It's now 1024 bytes without any string.

    I will try to optimize some more size-wise so I can put back the string at least partially.

    On another note, some more docs are coming, stay tuned !

  • Better sleep

    dumitru.stama12/02/2016 at 03:58 2 comments

    I replaced the infinite loop in the idle task with "wfi" instruction. Theoretically this should put the processor to sleep until the next systick interrupt and this will save energy. I said theoretically because it needs some setup but it seems to work out of the box so I will keep it as an option.

    I also uploaded the RAM memory map.

  • Documentation

    dumitru.stama12/01/2016 at 06:35 0 comments

    All sources are fully commented but proper video documentation will follow in the next couple of days.

    If there is enough interest I might even make a step-by-step building videos.

    Stay tuned