-
Notifications
You must be signed in to change notification settings - Fork 8
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
Added gcc cross-compiler support + Makefile #1
base: master
Are you sure you want to change the base?
Conversation
Hi, I updated the pull request and incorporated some fixes, forgot the syscall.c newlib-wrapper, sry. |
Hmm I got this. I tried to compile it with @jsnyder's arm-eabi-toolchain.
|
FWIW, i got it to link using |
gcc arm embedded toolchain, see first post. There are also builds for mac osx. I figured out the problem: At the end of the startup code (startup_LPC17xx.S), the _start symbol is called. That function is typically defined inside the newlib libc startup code (libgloss/crt0.so) in the target directory, but your toolchain is kinda barebone and doesn't include startup code at all and only a few multilib targets (--disable-libgloss inside the toolchain build makefile). I'am not quite sure if newlib will work as expected if the you just skip the libc initialisation, but it could work if you substitute _start on line 147 of ./Base/Core/CM3/DeviceSupport/NXP/LPC17xx/startup/gcc/startup_LPC17xx.S with main:
|
Okay, I flashed an image produced by this toolchain using |
Hmm. Yeah I can't get it to flash properly using (shasum |
Hi, can you please send me the output of hexdump -C your.bin |head -n 20 ? thx, ths Ricardo Gomes da Silva wrote:
1 bottle of beer on the wall, you take one down, pass it around, 0 bottles [email protected] _ 3072R/0x98459AB6 20B244DE 25378169 3E0597FA CF20D03F 98459AB6 |
@devio, here you go:
Regards, Ricardo |
Hey Ricardo, Ricardo Gomes da Silva wrote:
This is the interrupt vector table (entries 0-7). Entry 7 is a special entry and The LPC17 bootloader now assumes, that the user-code is not correct and is However, before a binary file can be flashed to the LPC17, you need to execute The calculation of the checksum is rather simple and specified in the LPC17 user I hope this helps - if not, let me know.. unfortunately i don't have written any cheers & regards, Thorsten 1 bottle of beer on the wall, you take one down, pass it around, 0 bottles [email protected] _ 3072R/0x98459AB6 20B244DE 25378169 3E0597FA CF20D03F 98459AB6 |
I was kinda lazy and decided to google for a code ready to use for calculating the checksum, and I've found this: http://www.lpcware.com/content/nxpfile/lpc177x8x-checksum-insertion-program. Using this against @nedos's
Based on this, I compiled the ddk-arm image and patched with the checksum:
Finally, I flashed it and it's still not working, going straight to the bootloader. Is there anyway to debug it? :) One thing that I noticed is that compiling the binary image won't give the same as @nedos's. I assume this is because it's a different version. |
Ricardo Gomes da Silva wrote:
Good point! This program looks good...
Hm, are you sure you're really executing the bootloader? Have you attached
Maybe minor compiler version differences... doesn't make me wonder... Have you also checked if you rolled back to your previous version? Previously Regards, Thorsten 1 bottle of beer on the wall, you take one down, pass it around, 0 bottles [email protected] _ 3072R/0x98459AB6 20B244DE 25378169 3E0597FA CF20D03F 98459AB6 |
@devio, hm, I didn't really check if it was running the bootloader or not. Turns out it's not, it's hanging somewhere else. I wrote And yes, I rolled all changes back, just in case:
Regards, Ricardo |
Hey, Ricardo Gomes da Silva wrote:
hm... now this can be anything :( I'd attach a JTAG debugger to see what Unfortunately i'm pretty busy this week and unable to reproduce the behavior and cheers, Thorsten 1 bottle of beer on the wall, you take one down, pass it around, 0 bottles [email protected] _ 3072R/0x98459AB6 20B244DE 25378169 3E0597FA CF20D03F 98459AB6 |
Sure, no problem! I started debugging with the LEDs after I figured out how to make them work! :) I kinda figured out what's the problem. Any call to Btw, I tried both with the toolchain you specified, as well with another one avaiable in AUR (https://aur.archlinux.org/packages/arm-none-eabi/), and in both toolchains I had to change Cheers, Ricardo |
Okay, a new day, a new try. With JTAG, I was able to locate the problem. There was absolutely no global DATA initialization and BSS zeroing. So some predefined global pointers of the libc were dangling around. I also increased the stack and heap size and moved them to sram. For me, It seems to work after flashing it with @nedos libusb-lpcflash fork. Nevertheless, this means not much, so please, test it :) |
@notandy Nice job, it worked on the first try! I didn't fully test it, but from what I saw so far it works as expected. |
Okay, the binary @notandy uploaded worked for me. However, the project still doesn't build successfully with my arm toolchain. I'm gonna try a handful of things and report back. @rgsilva: I'm assuming you're still running the same gcc-arm-embedded toolchain as @notandy? |
Okay, I can confirm this is working for me now. At least the flashing. I'm going to do a few more tests though. |
Okay I'm still having some issues. The binary that I get as a result, but the command line is a bit broken which makes me think that the linker script isn't working for me. |
@nedos How broken? |
I see some debug printfs that are gone in the version I compile with crossworks. Also sometimes the printf returns a line twice, i.e.
|
Oh, that's true. I didn't notice until now. |
Okay, hopefully this fixes the I/O bugs you encountered. |
@notandy Nice! Tested here and it works perfectly (as far as I can tell, at least). The checksum patch also worked like a charm. :) |
was there a reason this wasn't merged? |
Greetings,
I couldn't resist and added gcc support to datenkrake firmware. Tested with GNU Tools for ARM Embedded Processors ( https://launchpad.net/gcc-arm-embedded/+download ) and flashed via jtag.
But I'am to dumb to test the lpc on-rom bootloader flasher, maybe you have more luck.
cya
andy