Skip to content
Snippets Groups Projects
Select Git revision
  • esb_py
  • master default protected
  • analog_gpio
  • config
  • esb
  • esb_squashed_nopy
  • card10.cfg
  • fix-intid
  • hwlock_pc
  • jailbreak
  • debug_module
  • gpio_fix
  • fd_ownership
  • moar_blacklist
  • hula
  • mx_printf
  • fileapi
  • dir
  • tidy
  • fatfs-generation
20 results

serial.c

Forked from card10 / firmware
Source project has a limited visibility.
  • rahix's avatar
    32681478
    fix(serial): Perform serial prints in a critical section · 32681478
    rahix authored
    
    Sometimes during initialization, one `log_msg()` intercepts another one,
    leading to a whole lot of weird issues in other modules (like I2C).  I
    suspect this to be memory corruption of some kind.  The issues can be
    fixed by performing serial prints in a critical section, thus ensuring
    atomicity of prints.  Note that this does not mean log messages will not
    interleave.
    
    The CDC-ACM and BLE-Serial writes cannot be put into a critical section
    and are thus a point where this code can still fail.  For now, however,
    this fix ensures the race-conditions during startup, where USB and BLE
    are not yet running, don't happen anymore.
    
    Signed-off-by: default avatarRahix <rahix@rahix.de>
    Verified
    32681478
    History
    fix(serial): Perform serial prints in a critical section
    rahix authored
    
    Sometimes during initialization, one `log_msg()` intercepts another one,
    leading to a whole lot of weird issues in other modules (like I2C).  I
    suspect this to be memory corruption of some kind.  The issues can be
    fixed by performing serial prints in a critical section, thus ensuring
    atomicity of prints.  Note that this does not mean log messages will not
    interleave.
    
    The CDC-ACM and BLE-Serial writes cannot be put into a critical section
    and are thus a point where this code can still fail.  For now, however,
    this fix ensures the race-conditions during startup, where USB and BLE
    are not yet running, don't happen anymore.
    
    Signed-off-by: default avatarRahix <rahix@rahix.de>