Other Parts Discussed in Thread: MSP430G2553,
I've implemented a custom BSL bootloader for a project based on MSP430G2553 and BSL works flawlessly on a Windows PC using a UART link. Then I've managed to compile the BSL Scripter on a Linux-based ARM device (ODROID C2 and XU4) and it fails badly.
I've tracked down the issue and found out that many variables used on UartComm::receiveBuffer() are updated asynchronously, but aren't declared volatile. On x86 CPU this is rarely an issue since they don't have many registers for optimization and access of all data tends to use RAM, but this is not the case on optimized ARM code. So the read loop fails badly.
As I don't know the inner working of all the boost stuff I've made a superficial analysis to solve that: I've put a volatile on the declarations of variables timerEvent, actSize, expSize and bytesReceived of the UartComm and now it works flawlessly.
Maybe one should make a in-depth analysis and publish an update to this source code, specially regarding the use of volatile, since I've found situations where it is unnecessarily used in synchronous code and missing, as I already stated, on asynchronous code.
Best Regards,
Mathias Gruber