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
Up front, this is a custom design, based on ItsyBitsy M4. I've made several variants based on your excellent ItsyBitsy M4 foundation but this is the first time I have wanted to use the hardware UART. Took me a little while to find what was going on but it appeared that the UART baud was 2.5x the value passed to the Serial.begin() function. This makes me suspect that somehow the UART SERCOM is taking the 120MHz main clock instead of the expected 48MHz clock in #define SERCOM_FREQ_REF 48000000ul in SERCOM.h.
I have obviously tested on my ItsyBitsy M4 and as expected the baud rate is perfect. I'm using the same SERCOM (3), the same port pins (PA16, PA17), same pads settings, same 120 MHz main clock. Only difference hardware-wise that I can see is that I'm using the J variant with more pins.
I have .build.extra_flags=-D__SAMD51J19A__ -D__SAMD51__ {build.usb_flags} -D__FPU_PRESENT -DARM_MATH_CM4 -DCRYSTALLESS -mfloat-abi=hard -mfpu=fpv4-sp-d16 in boards.txt so I am expecting the __SAMD51__ flag is triggering the relevant preprocessor macros, such as these lines in SERCOM.cpp:
What could be causing the build to fail to recognise that flag and skip to the !__SAMD51__ condition? Happy to post more but not sure what would be most useful.
The text was updated successfully, but these errors were encountered:
Hmm, I would not expect the image to build and run successfully if something goes wrong with the __SAMD51__ define. Can you just put a typo / wrong character in the line you expect to be ignored and check if the compilation fails? Only to see if it's really that sort of problem.
Up front, this is a custom design, based on ItsyBitsy M4. I've made several variants based on your excellent ItsyBitsy M4 foundation but this is the first time I have wanted to use the hardware UART. Took me a little while to find what was going on but it appeared that the UART baud was 2.5x the value passed to the
Serial.begin()
function. This makes me suspect that somehow the UART SERCOM is taking the 120MHz main clock instead of the expected 48MHz clock in#define SERCOM_FREQ_REF 48000000ul
inSERCOM.h
.I have obviously tested on my ItsyBitsy M4 and as expected the baud rate is perfect. I'm using the same SERCOM (3), the same port pins (PA16, PA17), same pads settings, same 120 MHz main clock. Only difference hardware-wise that I can see is that I'm using the J variant with more pins.
I have
.build.extra_flags=-D__SAMD51J19A__ -D__SAMD51__ {build.usb_flags} -D__FPU_PRESENT -DARM_MATH_CM4 -DCRYSTALLESS -mfloat-abi=hard -mfpu=fpv4-sp-d16
inboards.txt
so I am expecting the__SAMD51__
flag is triggering the relevant preprocessor macros, such as these lines inSERCOM.cpp
:What could be causing the build to fail to recognise that flag and skip to the
!__SAMD51__
condition? Happy to post more but not sure what would be most useful.The text was updated successfully, but these errors were encountered: