添加链接
link管理
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接
Hello,

FYI.

I am experiencing USB-OTG driver malfunction on the STM32F7 (have to verify others) when using GCC 4.9. The board is enumerated but no communication occurs, the COM port fails when opened on the host side.

So far I assessed:
1) GCC 4.7 works as usual.
2) Changing from -O2 to -O0 makes no difference so the optimization level does not matter.
3) Disabling LTO makes no difference.
4) Various 4.9 releases make no difference, I tried q1 and q3, same result.

I recommend staying with GCC 4.7 until the problem is fully understood.

Giovanni
Now I know the problem or one of the problems.

The function strcasecmp() crashes because the global pointer __CTYPE_PTR__ points to an unmapped memory area, it should point to a char array named _ctype_.

The cause of this is still unknown. I know that the wrong data is in the binary image so it is not a flashing error.

Giovanni
I am getting closer to the problem, this is how it can be reproduced:

Code: Select all


static const char ___aaa[] = "aaa";

char const * ___aaap = ___aaa;

int main(void) {
...
sdWrite(&SD1, (const uint8_t *)___aaap, 4);
}


The pointer passed to sdWrite() is garbage, this happens with the F7 but not the F4, I suspect it is a linker issue triggered by the F7 linker script (different from F4 one). It should be a linker problem because GCC 4.7 works perfectly.

Giovanni