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

LPC824: export to LPCXpresso, target running with wrong clock speed #2884

Closed
JojoS62 opened this issue Oct 2, 2016 · 6 comments
Closed

LPC824: export to LPCXpresso, target running with wrong clock speed #2884

JojoS62 opened this issue Oct 2, 2016 · 6 comments

Comments

@JojoS62
Copy link
Contributor

JojoS62 commented Oct 2, 2016

LPC824: export to LPCXpresso, target running with wrong clock speed

Description

  • Type: Bug

Bug

Target
LPC824, LPCXpresso824-MAX

Toolchain:
GCC_CR

Toolchain version:
LPCXpresso V8.2.0

meed-os sha:
729ef15 Merge pull request #2682 from ohagendorf/bugfix_can_loop_test

Expected behavior
System clock should be set to 30 MHz.

Actual behavior
System clock is 12 MHz.
Steps to reproduce
export blinky to LPCXpresso, use Blinky test program. Blink frequency is wrong by factor 2.5 (30 / 12).

Enhancement

Suggested enhancement
SystemInit() is not called in startup_LPC812_CR.cpp because of missing define:

#if defined (__USE_CMSIS) || defined (__USE_LPCOPEN)
// Declaration of external SystemInit function
extern void SystemInit(void);
#endif

because of missing _USE_CMSIS define.
Solution:
_USE_CMSIS could be added in the project defines. But this define is used only once here. Maybe another existing define could be used for this purpose?

@sg-
Copy link
Contributor

sg- commented Jan 19, 2017

Do you mind making a pull request with this fix?

@JojoS62
Copy link
Contributor Author

JojoS62 commented Jan 20, 2017

I have commited the fix to my forked repo. (How) can I send the PR for this single commit? There are other committs that are not necessary or confusing?

@theotherjimmy
Copy link
Contributor

Assuming that armmbed is the name of the remote corresponding to this repo, and that origin point to your fork:

  1. git checkout armmbed/master -b fix-lpcxpresso-clock
  2. git cherry-pick 77fc7dc1c
  3. git push origin
  4. go to https://github.com/ARMmbed/mbed-os
  5. Push the compare and PR button for JojoS62:fix-lpcxpresso-clock branch

I hope that helps.

@JojoS62
Copy link
Contributor Author

JojoS62 commented Jan 20, 2017

ok, that worked, hope I've done it right because this is my first PR.

@theotherjimmy
Copy link
Contributor

Yeah! It looks good.

sg- added a commit that referenced this issue Feb 9, 2017
Fix for #2884, LPC824: export to LPCXpresso, target running with wron…
0xc0170 pushed a commit that referenced this issue Feb 13, 2017
…g clock speed

SystemInit() was called condititionally, but necessary defines were not
set in mbed. Calling SystemInit() unconditional now.
Removed also conditiional calls to legacy CodeRed lib.
@JojoS62
Copy link
Contributor Author

JojoS62 commented Jul 24, 2017

This issue is fixed and meanwhile GCC_CR has become obsolete. The startup code in GCC_ARM toolchain includes a call to SystemInit and this toolchain should be used.

@JojoS62 JojoS62 closed this as completed Jul 24, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants