You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In LUFAConfig.h, USE_RAM_DESCRIPTORS is set if (RAMEND - RAMSTART) >= 512. Assumedly this is to free up Flash by putting the USB Descriptor structs in RAM if the MCU has at least 512 bytes of SRAM.
But RAMEND is the last address of RAM, so RAMEND - RAMSTART returns one less than the RAM size. For example, for the atmega16u2, RAMEND is defined as(RAMSTART + RAMSIZE - 1) where RAMSIZE is 512.
The USB Descriptors seem to occupy 138 bytes, so assumedly would fit in the 16u2's 512 bytes of SRAM. Alas, there's a second issue - HoodLoader2 reserves the first 386 bytes for the rx/tx buffers! So the check fails anyway, because 386 + 138 > 512.
So I think the fix should be to compensate for RAM_OFFSET in the LUFAConfig check, and maybe for the size of the descriptors if we can get that accurate, but I'm not quite sure where responsibility lies...
The text was updated successfully, but these errors were encountered:
In LUFAConfig.h,
USE_RAM_DESCRIPTORS
is set if(RAMEND - RAMSTART) >= 512
. Assumedly this is to free up Flash by putting the USB Descriptor structs in RAM if the MCU has at least 512 bytes of SRAM.But
RAMEND
is the last address of RAM, soRAMEND - RAMSTART
returns one less than the RAM size. For example, for the atmega16u2,RAMEND
is defined as(RAMSTART + RAMSIZE - 1)
whereRAMSIZE
is 512.The USB Descriptors seem to occupy 138 bytes, so assumedly would fit in the 16u2's 512 bytes of SRAM. Alas, there's a second issue - HoodLoader2 reserves the first 386 bytes for the rx/tx buffers! So the check fails anyway, because 386 + 138 > 512.
So I think the fix should be to compensate for RAM_OFFSET in the LUFAConfig check, and maybe for the size of the descriptors if we can get that accurate, but I'm not quite sure where responsibility lies...
The text was updated successfully, but these errors were encountered: