Skip to content
Snippets Groups Projects
  1. Feb 02, 2020
  2. Dec 22, 2019
    • rahix's avatar
      chore(max30001): Port to new mutex and hw-lock APIs · 6da4644e
      rahix authored
      
      Using a FreeRTOS mutex directly is deprecated.  Replace it with a
      `struct mutex`.  Similarly, the deprecated `hwlock_acquire_timeout()`
      is replaced with `hwlock_acquire()`.
      
      Signed-off-by: default avatarRahix <rahix@rahix.de>
      6da4644e
    • rahix's avatar
      feat(hw-locks): Introduce new hw-lock API · 605d5e56
      rahix authored
      
      Re-add a `hwlock_acquire()` method, but this time without a timeout
      parameter.  From a functional point of view, this is just a wrapper
      around `mutex_lock()`.
      
      Additionally, add `hwlock_acquire_nonblock()` which behaves like
      `mutex_trylock()`.
      
      Signed-off-by: default avatarRahix <rahix@rahix.de>
      605d5e56
    • rahix's avatar
      chore(hw-locks): Rename to hwlock_acquire_timeout · 610a3048
      rahix authored
      
      Rename hwlock_acquire() to hwlock_acquire_timeout() in preparation for
      future changes to the hw-lock API.  Change all uses of the hw-lock API
      to reflect this change.
      
      This commit does not introduce any functional changes, except getting
      rid of the timeout usage warnings.  This change is no-op, because the
      hwlock_acquire() implementation already replaces any non-zero timeout
      value with portMAX_DELAY.
      
      Signed-off-by: default avatarRahix <rahix@rahix.de>
      610a3048
    • rahix's avatar
      feat(hw-locks): hwlock_release() should return void · 18202736
      rahix authored
      
      With the switch to the new mutex API, hwlock_release() cannot fail under
      any circumstances.  To emphasize this, make it return void instead of
      int (Previously it just always returned 0).
      
      Signed-off-by: default avatarRahix <rahix@rahix.de>
      18202736
  3. Nov 03, 2019
    • rahix's avatar
      chore(api-lock): Port to new mutex API · 75278836
      rahix authored
      
      Using a bare FreeRTOS mutex is deprecated.  Replace it with the new
      `struct mutex`.  This should increase stability.
      
      Additionally, fix a bug in `lifecycle.c:do_load()` where the function
      would return without unlocking the API mutex if `hardware_reset()`
      returns an error.
      
      Signed-off-by: default avatarRahix <rahix@rahix.de>
      75278836
  4. Oct 05, 2019
    • rahix's avatar
      feat(epicardium): Add a panic() function · 1536da34
      rahix authored
      
      In unrecoverable situations we should provide a common way to output the
      cause of the error and then reset the CPU.  The panic() function is
      mean to be exactly that.  It outputs the error-cause, stack-trace, and
      firmware revision, accompanied by a link to the issue-tracker to
      encourage people to report the error.  After a timeout of ~1.5s it
      resets the CPU and reboots.
      
      Future Work:
      
       - Right now, the stack-trace only has a depth of one which is the
         return address from where panic() was called.  In the future it might
         make sense to provide a deeper stack-trace if a robust implementation
         is possible.
       - Integration of @msgctl's faultscreen (!79) so users who don't have
         the serial console open at all times can also see what happened.
      
      Signed-off-by: default avatarRahix <rahix@rahix.de>
      1536da34
    • rahix's avatar
      feat(serial): Add function to switch serial to synchronous · 5e25bc89
      rahix authored
      
      In severe error conditions, asynchronous prints will never work.  For
      such cases we need a way to make prints happen synchronously again, the
      same way it works during early boot.  Add a serial_return_to_synchronous()
      function which unconditionally switches the serial driver code to
      synchronous mode.
      
      Only use this function in unrecoverable error conditions!
      
      Signed-off-by: default avatarRahix <rahix@rahix.de>
      5e25bc89
  5. Sep 15, 2019
    • rahix's avatar
      feat(serial): Add serial_flush function · 86c8339e
      rahix authored
      
      serial_flush() allows flushing the serial buffer from anywhere in
      Epicardium.
      
      - When run from thread mode it will flush to UART, CDC-ACM and BLE.
        This is similar to what the serial task would do once it is
        rescheduled.
      - When run inside an exception handler, it will only flush to UART
        because CDC-ACM and BLE cannot be flushed from an ISR.  Note that
        characters flushed this way will never appear on the other outputs,
        even if the serial task is scheduled at some point afterwards.
      
      The main use of this function is to ensure output of messages even in
      cases of critical failures.
      
      Signed-off-by: default avatarRahix <rahix@rahix.de>
      86c8339e
  6. Sep 14, 2019
  7. Aug 31, 2019
  8. Aug 30, 2019
  9. Aug 24, 2019
  10. Aug 23, 2019
  11. Aug 22, 2019
  12. Aug 21, 2019
  13. Aug 20, 2019
  14. Aug 15, 2019
    • rahix's avatar
      feat(epicardium): Add core 1 lifecycle · b7c0b608
      rahix authored
      
      This commit introduces a lifecycle for core 1.  Based on the new loading
      system, a few APIs are made available to control the payload running on
      core 1.  These are:
      
      1. From core 1 (Pycardium, L0dable):
      
          - `epic_exec(name)` API Call:  Request loading of a new payload by
            name.  If the file does not exist, the call will return with an
            error code.  Otherwise, control will go to the new payload.
          - `epic_exit(retcode)` API Call:  Return from payload
            unconditionally.  This call should be called whenever a payload is
            done or when it has hit an unrecoverable error.  On `epic_exit`,
            Epicardium will reset the core back into the menu.
      
      2. From inside Epicardium:
      
          - `epic_exec(name)`: This is **not** the same as the API call, as it
            needs a different implementation underneath.  It will load a new
            payload and wait until this load actually completed (synchroneous).
          - `return_to_menu()`: Return core 1 to the menu script no matter
            what it is currently doing.  This call is asynchroneous and will
            return immediately after scheduling the lifecycle task.  This task
            will then take care of actually performing the load.
      
      Signed-off-by: default avatarRahix <rahix@rahix.de>
      b7c0b608
    • rahix's avatar
      feat(epicardium): Add module for hardware init · be09c127
      rahix authored
      
      Signed-off-by: default avatarRahix <rahix@rahix.de>
      be09c127
    • rahix's avatar
      chore(epicardium): Move dispatcher into own module · 5f794074
      rahix authored
      
      Also add a mutex around API calls in preparation for future changes.
      
      Signed-off-by: default avatarRahix <rahix@rahix.de>
      5f794074
  15. Aug 09, 2019
    • swym's avatar
      feat(fatfs): Implement global FLASH lock · 6d1686e0
      swym authored and rahix's avatar rahix committed
      - Implement de-initialization
      - Wrap filesystem operations in semaphore
      - Introduce EpicFileSystem object and move epic_file_FOO(...)
        imlementations into efs_FOO(EpicFileSystem*, ...) functions.
      - epic_file_FOO(...) functions are now wrappers around the _fs_
        functions, but lock and unlock the global filesystem object before &
        after calls.  This way, all efs_ functions can assume that the
        necessary lock has been acquired.
      - libff: don't use FF_FS_REENTRANT, our own FS lock is enough
      6d1686e0
  16. Aug 06, 2019
  17. Aug 05, 2019
  18. Aug 02, 2019
  19. Jul 24, 2019
  20. Jul 21, 2019
Loading