Closed NikitaKhalyavin closed 10 months ago
Your How to reproduce
is not reproducible. You need to make sure others can actual reproduce what you are doing. At least
Ok, sorry for this. I've created a repo with working project. How to reproduce:
Compiler armcc v5.06 update 1 (build 61)
just want to say, since I don't use Keil, hopefully some people would know how to fix.
I think it's better to contact keil support for this compiler issue.
Based on my experience of IAR & Segger SES they are quite helpful.
I think the problem here is the different semantics of weak functions in Keil and in the GCC.
I solved the problem by removing TA_ATTR_WEAK from: void dcd_edpt0_status_complete(uint8_t rhport, tusb_control_request_t const * request);
In usbd_control.c I added an empty, yet weak declaration: TU_ATTR_WEAK void dcd_edpt0_status_complete(uint8_t rhport, tusb_control_request_t const * request) { (void)rhport; (void)request; }
In "usbd_control_xfer_cb" I removed the check for the existence and just added the call.
This should be done probably for all optional functions.
Operating System
Windows 10
Board
custom board with stm32f103c8t6
Firmware
examples/device/cdc_msc, but adopted manually for keil project with --gnu compiler option
What happened ?
When project is builded by keil armcc compiler, enumeration fails. The reason is a weak attribute in dcd_edpt0_status_complete function definition (dcd.h, string 135). The armcc compiler ignores function implementation in dcd_stm32_fsdev.c, and because of that device address is never actually set. I dont know, if it's necessary to fix it, but I think that this issue will be useful for other keil users anyway (I spent a week looking for a reason)
How to reproduce ?
Debug Log
No response
Screenshots
No response