diff options
author | Evan Lojewski <github@meklort.com> | 2020-02-17 20:47:13 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-02-17 20:47:13 -0700 |
commit | 23b478f335cd622049ad17f1f7ca4f0641200705 (patch) | |
tree | 2243e00ad65259233171f3fbc97eb898c806af3e /libs | |
parent | d2419a287fc52929c351fb7fed54bae323fedc54 (diff) | |
download | bcm5719-ortega-23b478f335cd622049ad17f1f7ca4f0641200705.tar.gz bcm5719-ortega-23b478f335cd622049ad17f1f7ca4f0641200705.zip |
printf: Remove nvm access from the ape as it triggers a race condition when the rx cpu is restarted. (#35)
Rather than print directly, the APE now using the host debug console only for printf.
The RX cpu (function 0 only) uses the debug console and forwards it over SPI when new data is available.
Diffstat (limited to 'libs')
-rw-r--r-- | libs/bcm5719/APE_sym.s | 14 | ||||
-rw-r--r-- | libs/bcm5719/bcm5719_sym.s | 4 | ||||
-rw-r--r-- | libs/printf/ape_putchar.c | 14 |
3 files changed, 13 insertions, 19 deletions
diff --git a/libs/bcm5719/APE_sym.s b/libs/bcm5719/APE_sym.s index a7bdf87..c8819b8 100644 --- a/libs/bcm5719/APE_sym.s +++ b/libs/bcm5719/APE_sym.s @@ -10,7 +10,7 @@ ### ################################################################################ ### -### @copyright Copyright (c) 2018, Evan Lojewski +### @copyright Copyright (c) 2020, Evan Lojewski ### @cond ### ### All rights reserved. @@ -56,7 +56,7 @@ .global SHM .equ SHM, 0x60220000 -.size SHM, 0x894 +.size SHM, 0x900 .global SHM_CHANNEL0 .equ SHM_CHANNEL0, 0x60220900 @@ -142,20 +142,16 @@ .equ FILTERS3, 0xa0078000 .size FILTERS3, 0x200 -.global DEBUG -.equ DEBUG, 0x60221000 -.size DEBUG, 0x1000 - .global SHM1 .equ SHM1, 0x60221000 -.size SHM1, 0x894 +.size SHM1, 0x900 .global SHM2 .equ SHM2, 0x60222000 -.size SHM2, 0x894 +.size SHM2, 0x900 .global SHM3 .equ SHM3, 0x60223000 -.size SHM3, 0x894 +.size SHM3, 0x900 diff --git a/libs/bcm5719/bcm5719_sym.s b/libs/bcm5719/bcm5719_sym.s index d3d6813..3371f9a 100644 --- a/libs/bcm5719/bcm5719_sym.s +++ b/libs/bcm5719/bcm5719_sym.s @@ -10,7 +10,7 @@ ### ################################################################################ ### -### @copyright Copyright (c) 2018, Evan Lojewski +### @copyright Copyright (c) 2020, Evan Lojewski ### @cond ### ### All rights reserved. @@ -52,7 +52,7 @@ .global SHM .equ SHM, 0xc0014000 -.size SHM, 0x894 +.size SHM, 0x900 .global SHM_CHANNEL0 .equ SHM_CHANNEL0, 0xc0014900 diff --git a/libs/printf/ape_putchar.c b/libs/printf/ape_putchar.c index 550222e..ea96a89 100644 --- a/libs/printf/ape_putchar.c +++ b/libs/printf/ape_putchar.c @@ -44,26 +44,24 @@ #include <printf.h> #include <em100_putchar.h> -#include <APE_DEBUG.h> +#include <APE_SHM.h> void _putchar(char character) { - uint32_t write_pointer = DEBUG.WritePointer.r32; + uint32_t write_pointer = SHM.RcpuWritePointer.r32; uint32_t word_pointer = write_pointer / 4; uint32_t byte_index = write_pointer % 4; uint32_t byte_mask = 0xFF << (byte_index * 8); - uint32_t new_word = DEBUG.Buffer[word_pointer].r32 & ~byte_mask; + uint32_t new_word = SHM.RcpuPrintfBuffer[word_pointer].r32 & ~byte_mask; new_word |= character << (byte_index * 8); - DEBUG.Buffer[word_pointer].r32 = new_word; + SHM.RcpuPrintfBuffer[word_pointer].r32 = new_word; write_pointer++; - if(write_pointer >= sizeof(DEBUG.Buffer)) + if(write_pointer >= sizeof(SHM.RcpuPrintfBuffer)) { write_pointer = 0; } - DEBUG.WritePointer.r32 = write_pointer; - - em100_putchar(character); + SHM.RcpuWritePointer.r32 = write_pointer; } |