Closed urish closed 3 years ago
Traced the issue to our LSRS (register) implementation.
Pre-compiled HEX file (of the above) sketch that reproduces the issue: test-printf.ino.hex
Unit test case (passes on the actual silicone, fails in the emulator):
it('should return zero for `lsrs r2, r3` with 32 bit shift', async () => {
await cpu.setPC(0x20000000);
await cpu.writeUint16(0x20000000, opcodeLSRSreg(r2, r3));
await cpu.setRegisters({ r2: 10, r3: 32 });
await cpu.singleStep();
const registers = await cpu.readRegisters();
expect(registers.r2).toEqual(0);
expect(registers.Z).toEqual(true);
expect(registers.C).toEqual(false);
});
To reproduce, compile the following sketch using the Arduino Mbed Core for RP2040:
Then run the result in the emulator. This will print to the serial console:
Instead of the expected result,
12 is 12
.