Skip to content

Commit 00a8baf

Browse files
ArcaneNibbledlech
authored andcommitted
pbio/drv/rproc/rproc_ev3.c: Clear PRU1 data RAM
The firmware expects .bss variables to be zeroed by the loader, which is this code here.
1 parent 6af34ee commit 00a8baf

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

lib/pbio/drv/rproc/rproc_ev3.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
#include <string.h>
1212

1313
#include <tiam1808/hw/hw_syscfg0_AM1808.h>
14+
#include <tiam1808/hw/hw_types.h>
1415
#include <tiam1808/hw/soc_AM1808.h>
1516
#include <tiam1808/pruss.h>
1617
#include <tiam1808/psc.h>
@@ -56,6 +57,10 @@ void pbdrv_rproc_init(void) {
5657
unsigned int *fw_start = (unsigned int *)&pbdrv_rproc_ev3_pru1_fw_start;
5758
uint32_t fw_sz = &pbdrv_rproc_ev3_pru1_fw_end - &pbdrv_rproc_ev3_pru1_fw_start;
5859
PRUSSDRVPruWriteMemory(PRUSS0_PRU1_IRAM, 0, fw_start, fw_sz);
60+
// Clear data RAM
61+
for (int i = 0; i < PRUSS_DATARAM_SIZE; i += 4) {
62+
HWREG(DATARAM1_PHYS_BASE + i) = 0;
63+
}
5964
// Set constant table C30 to point to shared memory
6065
PRUSSDRVPruSetCTable(1, 30, (((uint32_t)&pbdrv_rproc_ev3_pru1_shared_ram) >> 8) & 0xffff);
6166
PRUSSDRVPruEnable(1);

0 commit comments

Comments
 (0)