when in bootrom mode, the arg0 variable needed to be zeroed out before usage. We assign arg0 from a message before but we can discard that information in this particular case. Its quite odd to see the assignment failing but empty it out seems to have fixed it.

This commit is contained in:
iceman1001 2024-10-16 09:36:37 +02:00
parent e1fc066f55
commit 5ac1ae2e06

View file

@ -59,9 +59,9 @@ static int reply_old(uint64_t cmd, uint64_t arg0, uint64_t arg1, uint64_t arg2,
#if DEBUG
static void DbpString(char *str) {
uint8_t len = 0;
while (str[len] != 0x00)
while (str[len] != 0x00) {
len++;
}
reply_old(CMD_DEBUG_PRINT_STRING, len, 0, 0, (uint8_t *)str, len);
}
#endif
@ -131,14 +131,17 @@ static void UsbPacketReceived(uint8_t *packet) {
switch (c->cmd) {
case CMD_DEVICE_INFO: {
ack = false;
arg0 = 0;
arg0 = DEVICE_INFO_FLAG_BOOTROM_PRESENT |
DEVICE_INFO_FLAG_CURRENT_MODE_BOOTROM |
DEVICE_INFO_FLAG_UNDERSTANDS_START_FLASH |
DEVICE_INFO_FLAG_UNDERSTANDS_CHIP_INFO |
DEVICE_INFO_FLAG_UNDERSTANDS_VERSION |
DEVICE_INFO_FLAG_UNDERSTANDS_READ_MEM;
if (g_common_area.flags.osimage_present)
if (g_common_area.flags.osimage_present) {
arg0 |= DEVICE_INFO_FLAG_OSIMAGE_PRESENT;
}
reply_old(CMD_DEVICE_INFO, arg0, 1, 2, 0, 0);
}
@ -291,8 +294,9 @@ static void UsbPacketReceived(uint8_t *packet) {
break;
}
if (ack)
if (ack) {
reply_old(CMD_ACK, arg0, 0, 0, 0, 0);
}
}
// delay_loop(1) = 3.07us