InfiniTimeOrg / InfiniTime

Firmware for Pinetime smartwatch written in C++ and based on FreeRTOS
GNU General Public License v3.0
2.71k stars 926 forks source link

Build issue #52

Closed thibww67 closed 4 years ago

thibww67 commented 4 years ago

I managed to create my MakeFile but after that when I want to "make" it, I get these errors at 35% :

arm-none-eabi-gcc: error: BOARD_PCA10040: No such file or directory arm-none-eabi-gcc: error: CONFIG_GPIO_AS_PINRESET: No such file or directory arm-none-eabi-gcc: error: DEBUG: No such file or directory arm-none-eabi-gcc: error: DEBUG_NRF_USER: No such file or directory arm-none-eabi-gcc: error: FREERTOS: No such file or directory arm-none-eabi-gcc: error: NIMBLE_CFG_CONTROLLER: No such file or directory arm-none-eabi-gcc: error: NRF52: No such file or directory arm-none-eabi-gcc: error: NRF52832: No such file or directory arm-none-eabi-gcc: error: NRF52832_XXAA: No such file or directory arm-none-eabi-gcc: error: NRF52_PAN_12: No such file or directory arm-none-eabi-gcc: error: NRF52_PAN_15: No such file or directory arm-none-eabi-gcc: error: NRF52_PAN_20: No such file or directory arm-none-eabi-gcc: error: NRF52_PAN_31: No such file or directory arm-none-eabi-gcc: error: NRF52_PAN_36: No such file or directory arm-none-eabi-gcc: error: NRF52_PAN_51: No such file or directory arm-none-eabi-gcc: error: NRF52_PAN_54: No such file or directory arm-none-eabi-gcc: error: NRF52_PAN_55: No such file or directory arm-none-eabi-gcc: error: NRF52_PAN_58: No such file or directory arm-none-eabi-gcc: error: NRF52_PAN_64: No such file or directory arm-none-eabi-gcc: error: NRF52_PAN_74: No such file or directory arm-none-eabi-gcc: error: OS_CPUTIME_FREQ: No such file or directory arm-none-eabi-gcc: error: __HEAP_SIZE=8192: No such file or directory arm-none-eabi-gcc: error: __STACK_SIZE=8192: No such file or directory arm-none-eabi-gcc: error: unrecognized command line option '--defsym' arm-none-eabi-gcc: error: unrecognized command line option '--defsym' arm-none-eabi-gcc: error: unrecognized command line option '--defsym' arm-none-eabi-gcc: error: unrecognized command line option '--defsym' arm-none-eabi-gcc: error: unrecognized command line option '--defsym' arm-none-eabi-gcc: error: unrecognized command line option '--defsym' arm-none-eabi-gcc: error: unrecognized command line option '--defsym' arm-none-eabi-gcc: error: unrecognized command line option '--defsym' arm-none-eabi-gcc: error: unrecognized command line option '--defsym' arm-none-eabi-gcc: error: unrecognized command line option '--defsym' arm-none-eabi-gcc: error: unrecognized command line option '--defsym' arm-none-eabi-gcc: error: unrecognized command line option '--defsym' arm-none-eabi-gcc: error: unrecognized command line option '--defsym' arm-none-eabi-gcc: error: unrecognized command line option '--defsym' arm-none-eabi-gcc: error: unrecognized command line option '--defsym' arm-none-eabi-gcc: error: unrecognized command line option '--defsym' arm-none-eabi-gcc: error: unrecognized command line option '--defsym' arm-none-eabi-gcc: error: unrecognized command line option '--defsym' arm-none-eabi-gcc: error: unrecognized command line option '--defsym' arm-none-eabi-gcc: error: unrecognized command line option '--defsym' arm-none-eabi-gcc: error: unrecognized command line option '--defsym' arm-none-eabi-gcc: error: unrecognized command line option '--defsym' arm-none-eabi-gcc: error: unrecognized command line option '--defsym'

Do you have any solutions ?

Thank you !

lupyuen commented 4 years ago

Hi: Building the firmware on Windows may be tricky... Would you like to try building in the GitHub Cloud with GitHub Actions? Here are the steps...

https://lupyuen.github.io/pinetime-rust-mynewt/articles/cloud

lupyuen commented 4 years ago

Oh sorry if you browse the article a little more you'll see this fix, please try this...

If we see this error...

/home/runner/work/Pinetime/Pinetime/src/drivers/TwiMaster.cpp:1:10: fatal error: sdk/integration/nrfx/nrfx_log.h: No such file or directory
 #include <sdk/integration/nrfx/nrfx_log.h>
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
make[3]: *** [src/CMakeFiles/pinetime-app.dir/drivers/TwiMaster.cpp.o] Error 1

Browse to...

https://github.com/ACCOUNT_NAME/Pinetime/blob/master/src/drivers/TwiMaster.cpp

(Change ACCOUNT_NAME to our GitHub Account Name)

Edit the first two lines...

#include <sdk/integration/nrfx/nrfx_log.h>
#include <sdk/modules/nrfx/hal/nrf_gpio.h>

To...

#include <nrfx_log.h>
#include <nrf_gpio.h>

Click Commit Changes to save the file.

This triggers a new Firmware Build, which should succeed now.

thibww67 commented 4 years ago

Thank you for your answers !

Yes I noticed this just after I wrote my comment, it works and I managed to download the ZIP file. The last problem is that Nrf Connect seems to have change a little bit and I can't find the way to download the zip with the DFU. on Android.

Screenshot_20200811-131737_nRF Connect

lupyuen commented 4 years ago

Cool great! I think you need to flash the wired way the first time, after that nRF Connect will work.

Look in the "Other Options" section questions 4 and 5...

https://lupyuen.github.io/pinetime-rust-mynewt/articles/cloud#other-options

Do you have a Raspberry Pi? We will need to unprotect the Flash ROM with pinetime-updater as explained here...

https://github.com/lupyuen/pinetime-updater/blob/master/README.md#remove-flash-rom-protection

Then we can use pinetime-updater to flash the file pinetime-app.out (note that it's not the same as the other ZIP file)...

  1. Download the artifact pinetime-app.out from GitHub Actions.

  2. We'll get a ZIP file. Extract the PineTime Firmware Image inside: pinetime-app.out

  3. Flash with PineTime Updater...

    • Run ./run.sh. Select Latest Bootloader to flash the latest bootloader

    • Then run ./run.sh again. Select Downloaded File and pinetime-app.out

    • Flash to address 0x0

lupyuen commented 4 years ago

If you're still stuck, come chat with us on the PineTime Chatroom on Discord / Matrix / Telegram / IRC: https://wiki.pine64.org/index.php/PineTime#Community

thibww67 commented 4 years ago

Yes I still stuck because I have no Raspberry available right now.. I just managed to launch the Cmake command with OpenOCD but it changes nothing. I posted a thread on Pine64. Thank you for your time !

lupyuen commented 4 years ago

Sure no problem :-) I'm sorry that you had to get the first batch of PineTime watches, the upcoming batch will have built-in wireless flashing support.

Now that you have figured out how to build the firmware in the cloud, maybe you could experiment with Clock.cpp and make your own watch face :-)

https://lupyuen.github.io/pinetime-rust-mynewt/articles/pinetime#programming-with-pinetime

thibww67 commented 4 years ago

The project is very interesting but unfortunately I can not yet build the code on my Windows, and even if I build it, I don't really know if it is possible to flash it over USB.

But thank you for all your answers !

lupyuen commented 4 years ago

Sure I understand. We have a newcomer who developed their own Watch Face without a PineTime, by simply editing Clock.cpp and building with GitHub Actions.

We'll have a tutorial on that soon (written by our newcomer). Check with me on Twitter or Mastodon for updates :-)

https://twitter.com/MisterTechBlog

https://qoto.org/@lupyuen

borgmanJeremy commented 4 years ago

@thibww67 I have not tried it myself, but I think you should be able to build it on windows using windows subsystem for linux (WSL).

JF002 commented 4 years ago

I did not try to compile this project on windows, but this would be a nice addition. PR welcome :)

The documentation about NRFConnect is valid only if you've already programmed this project on your Pinetime. The stock firmware does not work that way.

You'll need a SWD debugger to program the firmware into your pinetime. And, as the Pinetime comes with the memory protected, you need a debugger than is able to unlock it (jlink, raspberrypi,...). The memory won't be locked in the next batch, but it's not available yet...

JF002 commented 4 years ago

I'm closing this issue as there's no activity for more than a month. @thibww67 reopen it if necessary.