Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Get blinky running again and update xpcc. #2

Open
wants to merge 8 commits into
base: master
Choose a base branch
from

Conversation

strongly-typed
Copy link
Member

@strongly-typed strongly-typed commented Aug 24, 2017

DFU method was removed but it will be added to xpcc. See roboterclubaachen/xpcc#285.

@salkinium
Copy link
Member

So… not sure how you feel about the ST USB stack, but it may be interesting to look at kevinmehall/usb for a OSS USB implementation. ST recently released a lower-level HAL than STCube, maybe that could be of use to port this. To be clear, I've used neither of these, so can make no call on the quality or ease-of-use, so feel free to ignore me (but please report back your experiences ;-)

@ekiwi
Copy link
Member

ekiwi commented Aug 25, 2017

Just FYI, as far as I know, the 48MHz clock is the only one that can be calibrated via the USB clock.

@strongly-typed
Copy link
Member Author

@ekiwi Thanks for pointing out that detail.
So I will try to care about the HSI48MHz clock and update the PR.

At the moment the device does not start after flashing with DFU in one of about ten tries.
I witnessed that the device stopped blinking after five or ten seconds (blinky example). That is very strange. My feeling was that it was much more reliable and stable when running from HSI8MHz.

This is hard to reproduce and hard to debug. Any suggestions?

- Test 8 MHz clock with PLL.
  - Got hard faults when switching to 48 MHz clock because flash latency was not set at all
  - HSI48MHz clock is working reliably
- Use common SConstruct from xpcc
- Add Logger to board file
- Add xpcc_abandon handler
- Move board file to separate directory
- Add OpenOCD config for SWD (without reset line)
- Successfully programmed the board with SWD and DFU
- Blinky and Button and USART TX works.
@strongly-typed
Copy link
Member Author

Ok, found it. Kevin's version did not set the flash latency at all. So running at 48 MHz with zero wait states is out of spec and pure luck. It is important to set the wait states before switching the clock.

I was not able to figure out why the reset after DFU programming does not work reliably. Pressing reset or just unplugging the device is a workaround.

You you please review? I will take care about CAN and USB in later PRs (and feature branches of course).

@salkinium Thanks for pointing at the USB stack. I probably won't try it now because someone Daniel knows has a running binary for the hardware. Will look into what is more convenient.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants