I had a project using SPI in MQX 3.6 running properly, and then some time later after recompiling the same project the SPI baud rate doubled for no apparent reason. I confirmed that I'm setting IO_IOCTL_SPI_SET_BAUD properly, but when I check the scope the baud is always double what I set. Has anyone seen this, or have an idea what's happening?
Thanks
Angelo
Solved! Go to Solution.
Hi Angelo,
I think I found the changed file when the GainSpan patch is applied for the MCF52259.
Here is a picture of the winmerge results.
Regards,
David
Hi Angelo,
The SPI Baus rate should not change with recompile unless the code changed too.
Did you apply a patch to MQX that might have changed the default setting?
Regards,
David
I assume I changed something, but I can't tell what. I did apply the Gainspan Wifi patch but I thought it only added it's own drivers and modified the twr52259 projects. I'm using the MCF52259EVB BSP so I didn't think it would affect anything. Maybe I'll reinstall MQX without the patch and do a diff on the after-patch files.
Hi Angelo,
Good idea to uninstall/re-install and compare.
I just did that and do not see the SPI Baud changing in the M52259EVB BSP or MQX/examples/SPI.
Regards,
David
I agree, it's baffling. And I'm not using the default setting in the BSP, I have my own define parameter which I know hasn't changed, that I pass using IO_IOCTL_SPI_SET_BAUD. I print the value just before it sets the value and it's correct. There must be something going on with a low level driver or on the hardware itself, clocks, dividers, etc.
Hi Angelo,
I think I found the changed file when the GainSpan patch is applied for the MCF52259.
Here is a picture of the winmerge results.
Regards,
David
Hmm, how about that! Thank you for finding this. I guess I can change it back and try, but I wonder why it was changed in the first place. I confirmed the original baud rate was correct. Should I notify someone about this, or is that something you would take care of on your end? (I'm not even sure if this patch is written by Freescale or GainSpan.) Or maybe this problem was already fixed for a later version.
Thanks again
Hi Angelo,
You are welcome.
I'll handle ensuring newest MQX is OK.
Just having this issue on the Community will help those using MQX3.6.
Regards,
David