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

nrf52810 - no fpu #17

Open
bitmat1 opened this issue Feb 28, 2023 · 5 comments
Open

nrf52810 - no fpu #17

bitmat1 opened this issue Feb 28, 2023 · 5 comments

Comments

@bitmat1
Copy link

bitmat1 commented Feb 28, 2023

I am unable to get this to compile for an nrf52810 as it has no floating point unit.
Is it possible to change the freertos to compile without FPU??

I've added an entry for it in Boards.txt and added system_nrf52810.h and .c files to the nrf mdk, but when i select "generic 52810" I get this error:

#error This port can only be used when the project options are configured to enable hardware floating point support

Weirdly, if I select generic nrf51822 as the board then it compiles and runs ok on this nrf52810 custom board, and example code shows that a bluetooth device is available. Should I just use this, or will all the pins and interrupts be wrong?

This post gives a solution but asm format is different and mighty confusing! https://devzone.nordicsemi.com/f/nordic-q-a/30103/freertos-on-nrf52810

@h2zero
Copy link
Owner

h2zero commented Feb 28, 2023

Hello @bitmat1, thank you for opening this issue and for providing a link to the potential solution. For testing please try removing the 3 lines from here

" tst r14, #0x10 \n" /* Is the task using the FPU context? If so, pop the high vfp registers too. */
which is the code section referred to in that link.

@bitmat1
Copy link
Author

bitmat1 commented Mar 1, 2023

Thanks @h2zero for your quick reply, I removed those lines, and also 3 more from line 208 onwards in the same file, which also referenced the fpu and then it compiled.
There was an "undefined reference to `SystemInit'" in gcc_startup_nrf52810.S:308: but after removing bl SystemInit on line 308 it all works. The function systemInit is defined in system_nrf52810, is it needed for this chip?
Should I make a nrf52810_nimconfig.h file next?
Thanks again for your help, I'm trying to make a miniature ble midi device using a tiny holyiot board, and it's more challenging than anticipated.

@h2zero
Copy link
Owner

h2zero commented Mar 1, 2023

There was an "undefined reference to `SystemInit'" in gcc_startup_nrf52810.S:308: but after removing bl SystemInit on line 308 it all works. The function systemInit is defined in system_nrf52810, is it needed for this chip?

That file will need to be added so that the startup is correct.

Should I make a nrf52810_nimconfig.h file next?

That would be advised for sure.

If you don't mind sharing, I would like to ask that you submit a PR with your changes so others may benefit as well.

@bitmat1
Copy link
Author

bitmat1 commented Mar 1, 2023

Yes absolutely, I've not made a pull request before, but i will do so and test it once i have this working.
I've made the nrf52810_nimconfig.h based on the nrf52832 one and now its giving me these errors when compiling the nimBLE client example: nrf_nvm_store.c:19: undefined reference to nrfx_nvmc_page_erase' and nrf_nvm_store.c:40: undefined reference to nrfx_nvmc_words_write'. But it seems like i'm very close to getting it working now.
Sorry for my ignorance, I am an electronics engineer who dabbles in coding and am way over my head with this.
How and where should I include system_nrf52810.h and nrfx_nvmc.h so these references are defined?

@bitmat1
Copy link
Author

bitmat1 commented Mar 1, 2023

I figured it out! I had copied the system_nrf52810 file from another copy of the mdk and wasn't correct and had to make an edit to the nrfx_config_nrf52810 file to enable nvmc. Now it's working and I'm very happy that i worked this out with your help. I will make a pull request. Thanks.

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

No branches or pull requests

2 participants