Skip to content

Commit

Permalink
In SOME cases, the pru ram cannot be cleared until after the PRU has …
Browse files Browse the repository at this point in the history
…started.
  • Loading branch information
dkulp committed Oct 8, 2023
1 parent 1a41c5f commit 058910d
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/util/BBBPruUtils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@
#include <thread>
#include <unistd.h>

#include "../log.h"
#include "../common.h"
#include "../log.h"

#include "BBBPruUtils.h"

Expand Down Expand Up @@ -60,8 +60,9 @@ class PRUCoreInfo {
fprintf(rp, "stop");
fclose(rp);
}
} else {
controlRegs[0] = 1;
}
controlRegs[0] = 1;
}
void enable(uint32_t addr = 0) {
if (!hasUIO) {
Expand Down Expand Up @@ -173,9 +174,6 @@ static void initPrus() {
prus[1].instructionRam = base_memory_location + (AM33XX_PRU1IRAM_PHYS_BASE - AM33XX_PRU_BASE);
prus[1].instructionRamSize = 8 * 1024;

memset(prus[0].dataRam, 0, prus[0].dataRamSize);
memset(prus[1].dataRam, 0, prus[1].dataRamSize);
memset(prus[0].sharedRam, 0, prus[0].sharedRamSize);
memset(ddr_mem_loc, 0, ddr_sizeb);
__asm__ __volatile__("" ::
: "memory");
Expand Down Expand Up @@ -234,6 +232,10 @@ int BBBPru::run(const std::string& program) {
prus[pru_num].disable();
CopyFileContents(program, "/lib/firmware/am335x-pru" + std::to_string(pru_num) + "-fw");
prus[pru_num].enable();

memset(prus[pru_num].dataRam, 0, prus[pru_num].dataRamSize);
memset(prus[pru_num].dataRam, 0, prus[pru_num].dataRamSize);

return false;
}

Expand Down

2 comments on commit 058910d

@derwin12
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Curious if this is related to a bug or something we might see in zoomroom?

@dkulp
Copy link
Contributor Author

@dkulp dkulp commented on 058910d Oct 9, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@derwin12 It would be a beagle based cape that will boot fine and run, but and restart (such as a push of config from xLights) would cause a crash loop and prevent fppd from starting, but a reboot would allow it to start again.

Please sign in to comment.