-
• #2
Hi,
Q1: Is there a specific switch that must be set in order to produce the .lst listing file?
For STM32 it 'just happens' - for nRF52 you need to do
... make lst
. Code listings when building natively (eg to run on your PC) aren't supported - but chances are you're not wanting to trawl through x86-64 assembly code so I doubt this is a big deal?Q2: Explanation please on: 'now you can "run ./espruino" '
Yes,
./command
is the Unix syntax for 'run the command in the current directory'.Chances are you did
BOARD=... RELEASE=1 make
which built Espruino for that board, not to run on your local PC - so there was no 'espruino' executable.To run it locally, all you need is:
make clean make ./espruino
If that fails, chances are the
make
step produced some errors?Have been successful in building using VSCode and flashing using esptool.py as a separate step. ... I may live to regret doing it this way
Yes, probably! I'm not sure what VSCode does, but on Windows 10 it is very easy: https://github.com/espruino/Espruino/blob/master/README_Building.md#under-windows
You just install WSL (which you may already have now): https://docs.microsoft.com/en-gb/windows/wsl/install-win10
Then follow the instructions for Linux: https://github.com/espruino/Espruino/blob/master/README_Building.md#under-linux-recommended
And it should work out of the box
Q3: As the GitHub source is all .c/.cpp is there a way to start and run my functions and wrappers from within VSCode to make use of breakpoints and the debugger there, without having to flash and call from the WebIDE? Is there a demo or test functions available?
So you want to compile and run Espruino on your PC and debug the functions there? That should be totally fine.
On linux (or WSL), you'd be doing something like:
make clean DEBUG=1 make gdb ./espruino
I don't use VSCode so I don't know what you need to do to debug there, but I imagine if you googled something like "debug Makefile projects in VSCode" it might work ok
-
• #3
as for VSCode it has handy WSL extension so you can edit files, use git/shell 'remotely' etc https://code.visualstudio.com/docs/remote/wsl-tutorial I guess there is similar/same remote extension for ssh. Did not try to debug or build directly with it but for editing and git it is quite nice.
-
• #4
Thr 2021.04.22
Thank you @Gordon and @fanoush for the prompt response.
More for Windows developers here:
'./command is the Unix syntax for 'run the command in the current directory''
Now having the knowledge on what I'm searching for, I found a nice detailed explanation:
https://unix.stackexchange.com/questions/4430/why-do-we-use-dot-slash-to-execute-a-file-in-linux-unix
'If you mean, why do you need ./ at the start - that's because (unlike in Windows), the current directory isn't part of your path by default. If you run:'
Will have a busy weekend reviewing those steps and going over those links. Thankx . . .
Tue 2021.04.20
Q1: Is there a specific switch that must be set in order to produce the .lst listing file? How, syntax, which file, etc. I'm looking in wrong folder maybe?
Q2: Explanation please on: 'now you can "run ./espruino" '
I'm not familiar with the "./" syntax and how to execute this step. Could this be a Unix, Make, source, .py, other toolchain command?
Tried from the terminal window within VSCode
I made the assumption this was Unix, but unable to search as the slash gets interpreted literally, but initial finds don't seem to support that:
Have been successful in building using VSCode and flashing using esptool.py as a separate step. Having much success flashing .ino files this way, has allowed me a two step process for Espruino builds, rather than using a VM as the GitHub README's suggest. I may live to regret doing it this way, and may learn it will be much faster as suggested, but for now I have a process that in mind, works.
I understand that I would need a main() function to do the following, but not sure where to place, how to call, so as to keep/allow the entire environment to run as if it were running Espruino waiting for JS instructions.
Q3: As the GitHub source is all .c/.cpp is there a way to start and run my functions and wrappers from within VSCode to make use of breakpoints and the debugger there, without having to flash and call from the WebIDE? Is there a demo or test functions available?
Thanks for the ongoing help and suggestions and look forward to additional learning this weekend.