STM32F2/4/7 MCUs use sectors instead of pages, where the minimum sector size is defined by FLASHPAGE_MIN_SECTOR_SIZE, which is 16KB or 32KB (the first sector) depending on the CPU_MODEL. In this case SLOT0_OFFSET must be a multiple of the minimum sector size to cover a whole sector.
This adds a check to the usbus control stack to ensure that the amount
of data received with a setup request does not exceed the amount
indicated within the setup request
This adds a sanity check to the line coding request of the CDC ACM code
to chcek the length parameter in the setup request with the size of the
expected payload struct
This truncates the incomming frames to ETHERNET_FRAME_LEN and silently
discards the rest of the frame until the end of the frame. This should
be modified to an endpoint halt condition after #17090 is merged, but
for now this should be good enough.
Stalling the endpoint with the current stall implementation could cause
a ping of death scenario, so for now the data is truncated until the
above solution can be implemented.
The SetLineCoding request is optional to support (CDC PSTN subclass). No
need to claim to support it to the host and actually discard the data if
it is not supported by the implementation.
This adds compile-time options to configure the serial of an USB
peripheral. The serial be autogenerated with a configured number of
bytes. It is also possible to configure a fixed serial string for a
device and disable the autogeneration of the serial.
Previously, the function would always return the max_len parameter.
This poses two issues:
1. the API requires to return the actual packet size
2. the API requires that if the packet is larger than max_len, the
packet is flushed and -ENOBUFS is returned
3. this basically bypasses the packet flushing, consequtive _recv()
would return the last packet again
This commit fixes those issues.
This changes the prefixes of the symbols generated from USEMODULE and
USEPKG variables. The changes are as follow:
KCONFIG_MODULE_ => KCONFIG_USEMODULE_
KCONFIG_PKG_ => KCONFIG_USEPKG_
MODULE_ => USEMODULE_
PKG_ => USEPKG_