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

Problem compiling for zephyr platform #2064

Closed
naichenzhao opened this issue Oct 18, 2023 · 7 comments
Closed

Problem compiling for zephyr platform #2064

naichenzhao opened this issue Oct 18, 2023 · 7 comments
Assignees

Comments

@naichenzhao
Copy link
Collaborator

I am trying to compile the code for zephyr on 0.5.2-SNAPSHOT and it seems to be looking for a file (CompileDefinitions.txt) that doesn't seem to exist.

(base) naichenzhao@Naichens-MacBook-Pro application % west lf-build src/Blinky.lf -w "-b nucleo_f446re -p always"
Executing lfc command: `lfc -c -n src/Blinky.lf`
lfc: info: Generating code for: file:/Users/naichenzhao/Desktop/lf-west/application/src/Blinky.lf
lfc: info: Generation mode: STANDALONE
lfc: info: Generating sources into: /Users/naichenzhao/Desktop/lf-west/application/src-gen/Blinky
Cleaning /Users/naichenzhao/Desktop/lf-west/application/bin
Cleaning /Users/naichenzhao/Desktop/lf-west/application/include
lfc: info: Code generation finished.
Traceback (most recent call last):
  File "/Users/naichenzhao/opt/anaconda3/bin/west", line 8, in <module>
    sys.exit(main())
  File "/Users/naichenzhao/opt/anaconda3/lib/python3.9/site-packages/west/app/main.py", line 866, in main
    app.run(argv or sys.argv[1:])
  File "/Users/naichenzhao/opt/anaconda3/lib/python3.9/site-packages/west/app/main.py", line 111, in run
    self.run_command(argv)
  File "/Users/naichenzhao/opt/anaconda3/lib/python3.9/site-packages/west/app/main.py", line 385, in run_command
    self.run_extension(args.command, argv)
  File "/Users/naichenzhao/opt/anaconda3/lib/python3.9/site-packages/west/app/main.py", line 467, in run_extension
    self.cmd.run(args, unknown, self.topdir, manifest=self.manifest,
  File "/Users/naichenzhao/opt/anaconda3/lib/python3.9/site-packages/west/commands.py", line 194, in run
    self.do_run(args, unknown)
  File "/Users/naichenzhao/Desktop/lf-west/scripts/lf_build.py", line 97, in do_run
    with open(f"{srcGenPath}/CompileDefinitions.txt") as f:
FileNotFoundError: [Errno 2] No such file or directory: 'src-gen/Blinky/CompileDefinitions.txt'
(base) naichenzhao@Naichens-MacBook-Pro application % 

@erlingrj
Copy link
Collaborator

erlingrj commented Oct 19, 2023

Thanks a lot for reporting this @naichenzhao. I had forgotten to update the lf-west-template. Please check out the most recent commit, and the documentation-update here: lf-lang/lf-lang.github.io#174

In short, you should pull the most recent commit from lf-west-template replace your command with:

west lfc src/Blinky.lf --build "-b nucleo_f446re -p always"

And it should work. Please let me know if you run into other problems.

@erlingrj
Copy link
Collaborator

Could you try building the examples again with the up-dated docs and lf-west-template repo @naichenzhao ?

@naichenzhao
Copy link
Collaborator Author

I re-downloaded the nightly version of lfc. Im not sure if its an issue on my end, but it seems I am getting a different error.

Screenshot 2023-10-24 at 2 36 01 PM

@erlingrj
Copy link
Collaborator

I have changed the layout of lf-west-template now. So the example apps should be located in:
apps/HelloWorld/ and apps/NrfBlinky. It looks like you have the old structure? Could you try pulling the latest version of lf-west-template and use the newest project layout. The command to run, from the root of the repo would be:
west lfc apps/HelloWorld/src/HelloWorld.lf --build "-b nucleo_f446re -p always"

@erlingrj
Copy link
Collaborator

See here for the most up-to-date docs. Please let me know if anything is unclear in them.

@naichenzhao
Copy link
Collaborator Author

Yeah, that's my bad. It works now, thank you very much.

@lhstrh
Copy link
Member

lhstrh commented Oct 25, 2023

Thanks for the fixes, @erlingrj, and thanks for confirming, @naichenzhao.

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

3 participants