TSDZ2 EBike wireless standard (like Specialized Turbo Levo) - OpenSource

beemac said:
gfmoore said:
Hi, so something isn't right in the code or my toolchain and I don't want to go down a rabbit hole.

I went into MAKEFILE and removed (eventually) three lines that referenced ant_key_manager

213 $(SDK_ROOT)/components/ant/ant_key_manager/config \ removed (why does # comment not work?)
then
211 $(SDK_ROOT)/components/ant/ant_key_manager \ removed
then
107 $(SDK_ROOT)/components/ant/ant_key_manager/ant_key_manager.c \

(I couldn't understand why the comment character # would comment the line and everything after it???)

Then I got an error in main.c so commented out //#include "ant_key_manager.h"

Then I got an error
...
Compiling file: main.c
./main.c: In function 'softdevice_setup':
./main.c:907:14: warning: implicit declaration of function 'ant_plus_key_set' [-Wimplicit-function-declaration]
907 | err_code = ant_plus_key_set(ANTPLUS_NETWORK_NUM);
| ^~~~~~~~~~~~~~~~
Compiling file: eeprom.c
...

I'm thinking before I start removing, commenting out any more code (that I don't know what it does) some thought may be in order ;)

I'm assuming you guys have been able to compile and not get these errors so what might be different to what you have and what I have cloned? Am I doing something stupid - probably as this is a bit new to me. I have used VSCode for personal web development projects, JavaScript etc, but the last time I programmed in C was in 1984 (ish) on an IBM PC clone. (No hard disk just 5 1/4 inch floppy disk and wrote a quicksort program - yay me!) :shock:

Gordon

Yea don't comment that out - is the nrf sdk in the firmware folder? I think in the repo the nrf sdk is (relative to the fw folder) ..\..\common_firmware so it can't be found.

Copy or junction nRF5_SDK_16.0.0 into the firmware folder if it's not there.

OK, ta, will have a look tomorrow. :D
 
Morning all from England in May, where snow has just fallen - doh!

Okay folks I think I've got myself in a bit of a tizz here, so started again.

VSCode from windows, into the WSL:Ubuntu 20.04 option. (This uses wsl2 to allow VSCode and Ubuntu to coexist.)

So I clone a repo, and this time I thought I'd have a go at the TSDZ2_wireless repo instead of the ebike_wireless_remote repo.

So that's fine, the folder exists on my Ubuntu instance and I can see it fine.

Question 1: I get a popup saying "This folder contains a workspace file 'workspace.code-workspace' .... Open Workspace.
Not sure what this does and tried opening and not opening, but not sure what it is doing? What should I do?

Anyway looked at the folder structure and saw yet another EBike_wireless_remote??? So there's a repo for ebike_wireless_remote and a subdir under TSDZ2_wireless called EBike_wireless_remote

Question 2: Which repo should folks be using?

Anyway I try moving on. I reopen a folder from VSCode and open the TSDZ2_wireless/EBike_wireless_remote/firmware folder.

Question 3: Is the the correct way of doing things?

Try clean, no worries, try build get an error:

> Executing task: make <

Code:
make: -gcc: Command not found
Cannot find: '-gcc'.
Please set values in: "/home/gordon/ebike/TSDZ2_wireless/EBike_wireless_remote/firmware/nRF5_SDK_16.0.0/components/toolchain/gcc/Makefile.posix"
according to the actual configuration of your system.
nRF5_SDK_16.0.0/components/toolchain/gcc/Makefile.common:129: *** Cannot continue.  Stop.
The terminal process "/bin/bash '-c', 'make'" failed to launch (exit code: 2).

Go to my Ubuntu terminal and check that gcc still works under that directory. It does. So is there something wrong with make?

Sorry about this, I'm sure it's just my ignorance :(

Gordon
 
gfmoore said:
Morning all from England in May, where snow has just fallen - doh!

Okay folks I think I've got myself in a bit of a tizz here, so started again.

VSCode from windows, into the WSL:Ubuntu 20.04 option. (This uses wsl2 to allow VSCode and Ubuntu to coexist.)

So I clone a repo, and this time I thought I'd have a go at the TSDZ2_wireless repo instead of the ebike_wireless_remote repo.

So that's fine, the folder exists on my Ubuntu instance and I can see it fine.

Question 1: I get a popup saying "This folder contains a workspace file 'workspace.code-workspace' .... Open Workspace.
Not sure what this does and tried opening and not opening, but not sure what it is doing? What should I do?

Anyway looked at the folder structure and saw yet another EBike_wireless_remote??? So there's a repo for ebike_wireless_remote and a subdir under TSDZ2_wireless called EBike_wireless_remote

Question 2: Which repo should folks be using?

Anyway I try moving on. I reopen a folder from VSCode and open the TSDZ2_wireless/EBike_wireless_remote/firmware folder.

Question 3: Is the the correct way of doing things?

Try clean, no worries, try build get an error:

> Executing task: make <

Code:
make: -gcc: Command not found
Cannot find: '-gcc'.
Please set values in: "/home/gordon/ebike/TSDZ2_wireless/EBike_wireless_remote/firmware/nRF5_SDK_16.0.0/components/toolchain/gcc/Makefile.posix"
according to the actual configuration of your system.
nRF5_SDK_16.0.0/components/toolchain/gcc/Makefile.common:129: *** Cannot continue.  Stop.
The terminal process "/bin/bash '-c', 'make'" failed to launch (exit code: 2).

Go to my Ubuntu terminal and check that gcc still works under that directory. It does. So is there something wrong with make?

Sorry about this, I'm sure it's just my ignorance :(

Gordon

Okay, making some progress. Looked into this workspaces thing, took a while to get my head around, but if I open a workspace, rather than a folder then it does what is logical :)

So I could build the EBike_wireless_TSDZ2 okay - yipee.
But not the EBike_wireless_remote :(
same error about make not findind -gcc - I think it's something to do with $PATH, but as I said I've never used C and make etc, well not seriously.


Still it's progress. :)

Gordon
 
gfmoore said:
gfmoore said:
Morning all from England in May, where snow has just fallen - doh!

Okay folks I think I've got myself in a bit of a tizz here, so started again.

VSCode from windows, into the WSL:Ubuntu 20.04 option. (This uses wsl2 to allow VSCode and Ubuntu to coexist.)

So I clone a repo, and this time I thought I'd have a go at the TSDZ2_wireless repo instead of the ebike_wireless_remote repo.

So that's fine, the folder exists on my Ubuntu instance and I can see it fine.

Question 1: I get a popup saying "This folder contains a workspace file 'workspace.code-workspace' .... Open Workspace.
Not sure what this does and tried opening and not opening, but not sure what it is doing? What should I do?

Anyway looked at the folder structure and saw yet another EBike_wireless_remote??? So there's a repo for ebike_wireless_remote and a subdir under TSDZ2_wireless called EBike_wireless_remote

Question 2: Which repo should folks be using?

Anyway I try moving on. I reopen a folder from VSCode and open the TSDZ2_wireless/EBike_wireless_remote/firmware folder.

Question 3: Is the the correct way of doing things?

Try clean, no worries, try build get an error:

> Executing task: make <

Code:
make: -gcc: Command not found
Cannot find: '-gcc'.
Please set values in: "/home/gordon/ebike/TSDZ2_wireless/EBike_wireless_remote/firmware/nRF5_SDK_16.0.0/components/toolchain/gcc/Makefile.posix"
according to the actual configuration of your system.
nRF5_SDK_16.0.0/components/toolchain/gcc/Makefile.common:129: *** Cannot continue.  Stop.
The terminal process "/bin/bash '-c', 'make'" failed to launch (exit code: 2).

Go to my Ubuntu terminal and check that gcc still works under that directory. It does. So is there something wrong with make?

Sorry about this, I'm sure it's just my ignorance :(

Gordon

Okay, making some progress. Looked into this workspaces thing, took a while to get my head around, but if I open a workspace, rather than a folder then it does what is logical :)

So I could build the EBike_wireless_TSDZ2 okay - yipee.
But not the EBike_wireless_remote :(
same error about make not findind -gcc - I think it's something to do with $PATH, but as I said I've never used C and make etc, well not seriously.


Still it's progress. :)

Gordon

I think? I've made progress - had to learn something about Makefiles which is a good thing :)

I compared the two make files and noted that the SDK_ROOT were different. I copied the SDK_ROOT from the TSDZ2_wireless and used it in the ebike_wireless_remote

# SDK_ROOT := ./nRF5_SDK_16.0.0
SDK_ROOT := ../../common_firmware/nRF5_SDK_16.0.0

Now it compiles. Progress.

Though I can now look at the code, I'm still waiting for components, mostly the Nordic board to arrive and most importantly my motor. It may be some time! :D

I'll copy in my instructions for setting up the toolchain asap for these to be tested and incorporated - don't ask me to do git stuff unless you explain very clearly what I have to do. :)

edit: btw there are warnings when I compile EBike_wireless_TSDZ2
Code:
Compiling file: eeprom.c
./eeprom.c: In function 'eeprom_init_variables':
./eeprom.c:272:14: warning: unused variable 'rt_vars' [-Wunused-variable]
  272 |   rt_vars_t *rt_vars = get_rt_vars();
      |              ^~~~~~~
Compiling file: state.c
./state.c: In function 'communications':
./state.c:369:5: warning: enumeration value 'MOTOR_INIT_OFF' not handled in switch [-Wswitch]
  369 |     switch (g_motor_init_state) {
      |     ^~~~~~
./state.c:369:5: warning: enumeration value 'MOTOR_INIT_GET_MOTOR_ALIVE' not handled in switch [-Wswitch]

etc

Gordon
 
Documentation: As promised.

# Instructions for setting up toolchain using Windows 10, Windows Subsystem for Linux (wsl2) and Ubuntu 20.04 LTS

6 May 2021 This is a work in progress

## Step 1: Set up and configure Windows Subsystem for Linux v2 (wsl2) on Windows 10

Here is a detailed explanation https://code.visualstudio.com/blogs/2019/09/03/wsl2 of what to do and check
You will then need to download Ubuntu 20.02 LTS from the windows store

So you can get into a bash shell for Ubuntu in various ways, but I just click on start menu and start typing Ubuntu ...

You should get a bash shell.

## Step 2: Update Ubuntu

```
sudo apt clean
sudo apt update
sudo apt upgrade
```

## Step 3: Install Visual Studio Code for Windows (VS Code)

Here we install VS Code as a normal windows app, not a Linux app - that doesn't work because wsl2 does not yet support GUIs (afaik) (Well I initially tried and it didn't work.)

## Step 4: Install the VS Code WSL extension

VS Code - Extensions: search Remote WSL and install - you may need to reboot VS Code (CTRL SHIFT P and Developer Reload Window or perhaps just Reload Window (I'm using an Insiders version of VS Code)

This is where the magic happens. This extension allows Vs Code to access the Linux subsystem rather than the windows workspace (if that's the right word?)

If you look at the very bottom left you will see a green icon

(TODO add images)

If you click on it you will get a popup window, click on "new WSL window" or try the other options :)
You don't need to keep the original VS Code is open. It will remember next time you open VS Code. To go back to Windows workspace click on green icon and select as appropriate.

Note how the green icon at the bottom left changes to "WSL:Ubuntu:20.04"
VS Code is now looking at the Linux workspace.

## Step 5: Install VS Code extensions

Install C/C++ Extension Pack - accept the message which installs Linux stuff
Install Cortex-debug in VSCode
Install Task manager extension (Zhang Shen??) (This is cool. It allows shortcuts to clean, build and other things you want to do - the json is in .vscode > task.json if you want to add your own.


## Step 6: Install Linux pre-requisites as per documentation

https://github.com/OpenSourceEBike/ebike_wireless_remote/blob/master/documentation/development-flash_and_debug_firmware.md

But in brief:

```
sudo usermod -a -G dialout USER_NAME so for me sudo usermod -a -G dialout gordon

sudo apt-get install openocd
sudo apt-get install gdb-multiarch
sudo apt-get install gcc-arm-none-eabi //takes a while
sudo apt-get install binutils-arm-none-eabi //quick
sudo apt-get install libnewlib-arm-none-eabi //quick
sudo apt-get install srecord //fairly quick

```

Note: I already had a toolchain installed for compiling C programs, that is gcc etc, but I can't remember what is needed. You may need to do this. Please let us know the details so it can be added to this document.

(I think it would be good to close down stuff and do a total reboot - it's upto you ;) )

Nearly there.

## Step 7: Clone a repo

For me I created a directory (folder = windows nomenclature!) called ebike.

Now in VS Code if you click on the folders icon at top left of the vertical bar (it's got a name but I forget - stack I think?) it will (should) show an option to open a folder or clone a repository. Choose clone and enter the location of the github repo you want - probably

https://github.com/OpenSourceEBike/TSDZ2_wireless

(This also contains the EBike_wireless_remote code, though there is also a higher level ebike_wireless_remote - I'm awaiting direction on which to use.)

## Step 8: Open the workspace you require

(This was new to me, but the repo TSDZ2_wireless uses a file called workspace.code-workspace that organises the projects - at least that's how I understand it. Opening a workspace allows you to open the project you are interested in (more easily perhaps?) )

https://code.visualstudio.com/docs/editor/workspaces

## Step 9: Clean and build

You can now use the icon on the left stack (probably at the bottom) (or in the hidden items indicated by ...) called Task Manager.

From the Task Manager select clean and the run icon, the build and the run icon.

Hopefully the project you opened compiles.

## Step 10: What else?

## Step 99: Do something cool!

Gordon Moore @ 6 May 2021
 
I'm so sorry for asking so many questions, but things aren't making sense.

This time it refers to opening the workspace for the TSDZ2_wireless/EBike_wireless_TSDZ2

I have opened the workspace for this folder. Well I assume I have.

2021-05-06_16-23-05.png

I can see main.c

2021-05-06_16-26-32.png

And as you can see there are issues in that the headers are not being found.

If I look at .vscode/c-cpp_properties.json I see

2021-05-06_16-30-53.png

Clearly this is looking at the wrong place.

However, even if I go up and down into /../../common_firmware/nRF5_SDK_16.0.0/sdk_config.h that file does not exist here?

This seems related to an issue I had right at the beginning :(

Can I ask a possibly insulting question and apologies in advance, but do the repos actually match what you have on "your" machines? :confused:
 
gfmoore said:
Documentation: As promised.
No big point to put documentation here as it will be lost in time. You need to read on google how to fork the project on your github account, do your changes there and finally submit a pull request to send the changes back, then we I will look for any missing part and accept the changes.
 
I received the new DC-DC and is so tiny that I wounder if I could quick adapt the wireless remote case to include this DC-DC, in exchange for the CR2032 battery. Also 2 mosfets must be added and more space for the motor controller UART cable...

The thing is I wanted this DC-DC to make the smallest possible TSDZ2 EBike wireless controller. But since it will be so small, I think there is potential to make a very small wired remote similar to the wireless remote. Hmmm, I do not have time, so for now I think I will build only the small TSDZ2 EBike wireless controller:

 
I started to build the board and I am so happy it is so small:





Here the board inside the box for previous board, with the big DC-DC, I used:


This time I hope to use some kind of potting or Hot melt adhesive (HMA) (also known as hot glue) to make the board and box a rigid block and water prof as I plan to install on the frame almost near where the TSDZ2 display cable ends, install with a very short cable.
 
casainho said:
gfmoore said:
Documentation: As promised.
No big point to put documentation here as it will be lost in time. You need to read on google how to fork the project on your github account, do your changes there and finally submit a pull request to send the changes back, then we I will look for any missing part and accept the changes.

Well I've done as you suggested and watched videos and read and forked the wiki and also the project. However I cannot fork the wiki and it's pages.
Even following https://stackoverflow.com/a/9452695 - I can't find the Git Access tab no matter if I forked the wiki only nor the project pages (the project page doesn't even have the wiki tab.

This stuff is so frustrating, no matter what I try to do I can't simply achieve what I want. Why does programming have to be so complex nowadays, so many options, so many fences to jump, so many dead ends, so much time wasted checking solutions that don't work... :(

So unless you have a suggestion as to what I can do I'm stuck.
 
gfmoore said:
casainho said:
gfmoore said:
Documentation: As promised.
No big point to put documentation here as it will be lost in time. You need to read on google how to fork the project on your github account, do your changes there and finally submit a pull request to send the changes back, then we I will look for any missing part and accept the changes.

Well I've done as you suggested and watched videos and read and forked the wiki and also the project. However I cannot fork the wiki and it's pages.
Even following https://stackoverflow.com/a/9452695 - I can't find the Git Access tab no matter if I forked the wiki only nor the project pages (the project page doesn't even have the wiki tab.

This stuff is so frustrating, no matter what I try to do I can't simply achieve what I want. Why does programming have to be so complex nowadays, so many options, so many fences to jump, so many dead ends, so much time wasted checking solutions that don't work... :(

So unless you have a suggestion as to what I can do I'm stuck.
The wiki is not active. You just need to fork the repository and edit the text files there, .md or add new files, like images or so.

Technology is now very complex and so we need to join our efforts, and for that there are kind of complex tools to do that.
 
@gfmoore, thanks for the contribution. Finally you are able to make the pull request.
 
casainho said:
gfmoore said:
casainho said:
gfmoore said:
Documentation: As promised.
No big point to put documentation here as it will be lost in time. You need to read on google how to fork the project on your github account, do your changes there and finally submit a pull request to send the changes back, then we I will look for any missing part and accept the changes.

Well I've done as you suggested and watched videos and read and forked the wiki and also the project. However I cannot fork the wiki and it's pages.
Even following https://stackoverflow.com/a/9452695 - I can't find the Git Access tab no matter if I forked the wiki only nor the project pages (the project page doesn't even have the wiki tab.

This stuff is so frustrating, no matter what I try to do I can't simply achieve what I want. Why does programming have to be so complex nowadays, so many options, so many fences to jump, so many dead ends, so much time wasted checking solutions that don't work... :(

So unless you have a suggestion as to what I can do I'm stuck.
The wiki is not active. You just need to fork the repository and edit the text files there, .md or add new files, like images or so.

Technology is now very complex and so we need to join our efforts, and for that there are kind of complex tools to do that.

Oh well, I've given it a go and set a pull request.

Yes tech is very complex, it always was - I remember trying to write programs for a PDP-11 and you should have see the long library shelf of manuals. No internet to try and find what you wanted.

But my point is that conceptually what we are trying to do is quite straightforward - Grab code, then edit, compile, test, do again; but it's the details and amount of configurations and setup that is sometimes quite astonishing and for a newbie (like me) to this area of programming it is daunting and difficult to know where to start and even know what questions to ask. And people are so busy (- how's your baby? born yet?). I, and no doubt many others, are simply very grateful for what you give. :D
 
casainho said:
But since it will be so small, I think there is potential to make a very small wired remote similar to the wireless remote.
...and only a bit larger and there is a full functional display just to plug into the TSDZ2 - like I have :wink:
 
Beli said:
casainho said:
But since it will be so small, I think there is potential to make a very small wired remote similar to the wireless remote.
...and only a bit larger and there is a full functional display just to plug into the TSDZ2 - like I have :wink:
I still think that we can not develop a display like the GPS cycling ones that have GPS navigation / track GPX navigation, show user heart rate graph and have specific cycling fitness metrics. So I prefer to use that ones, even if they are expensive.

gfmoore said:
And people are so busy (- how's your baby? born yet?). I, and no doubt many others, are simply very grateful for what you give. :D
Did not born yet but should soon. Thanks.

Here the new build, I am proud of the final result :)

Now I need to put some translucent tape to cover the button and LED holes. I will also fill the box with silicone, to make it very robust and water prof :)





 
dameri said:
Is it possible to put that small box inside TSDZ2 motor?

I suspect, since it uses Bluetooth, that you'd not want any metal in the way. I don't know if you can connect an aerial as my parts haven't arrived yet.
 
There is a void on the front side of the drive side, behind the plastic cover. It is big enough but you will still need some way of powering it up initially and for all the problems associated with it being in there, the simple solution of simply plugging it into the the 6 or 8 pin connector just seems so much more practical.
 
casainho said:
Now I need to put some translucent tape to cover the button and LED holes. I will also fill the box with silicone, to make it very robust and water prof :)


Very nice and compact. Why did you expose the button though? I didn't think it did anything...
 
beemac said:
casainho said:
Now I need to put some translucent tape to cover the button and LED holes. I will also fill the box with silicone, to make it very robust and water prof :)


Very nice and compact. Why did you expose the button though? I didn't think it did anything...

I was just checking to see what the button does in general. I didn't realise the component to the left of SW1 was the reset button that presses from the side. I assumed it was a point for connecting an external antenna...

nRF52840_dongle_press_reset.svg


https://infocenter.nordicsemi.com/index.jsp?topic=%2Fug_nrf52840_dongle%2FUG%2Fnrf52840_Dongle%2Fprogramming.html
 
gfmoore said:
Can I ask a possibly insulting question and apologies in advance, but do the repos actually match what you have on "your" machines? :confused:

Hi, bumping this.

I'm trying very hard to solve these issues but the repos for TSDZ2_wireless/EBike_wireless_TSDZ2 and TSDZ2_wireless/EBike_wireless_remote cannot be matching what you have on your development machines otherwise surely they would build as is.

As an example, I found in the TSDZ2_wireless/EBike_wireless_TSDZ2/firmware directory that I really needed a reference to nRF5_SDK_16.0.0 So which one do I use as there are a number of copies (versions of this around the repo?) I tried the one from TSDZ2_wireless/EBike_wireless_remote/firmware thinking that since you were developing these together they would be ok.

However, they are not, since for EBike_wireless_TSDZ2 there is a reference to pins.h which references boards.h which is found in (my now) TSDZ2_wireless/EBike_wireless_TSDZ2/firmware/nRF5_SDK_16.0.0/components\boards directory.

But this has an error:

Code:
#else
#error "Board is not defined"    <---wavy red lines => problem!

#endif

#ifdef __cplusplus
extern "C" {                 
#endif

This could be some development code that isn't used in the EBike_wireless_remote code and it was my bad luck to have chosen the wrong nRF5_SDK_16.0.0

I'm assuming that those who can build this code do not have any issues?

So again may I respectfully ask if the repos actually match your development systems and if not could they be fixed please as otherwise I am stuck before I can even begin to try and understand and make use of this open source code.

I suspect a good test would be for one of you devs to clone the current repo - TSDZ2_wireless - to some other directory on your machines and see if the projects will build? If it does then I am doing something really stupid in my setup and I apologise in advance.

Gordon.

edit: I'm beginning to suspect that the c_cpp_properties.json under .vscode may be the culrpit. I'm assuming that the nRF5_SDK_16.0.0 code is as provided and that nothing has been done to it?

My c_cpp_properties.json looks like:

Code:
{
    "configurations": [
        {
            "name": "nRF SDK 16.0.0",
            "includePath": [
                "${workspaceFolder}/**",
                "${workspaceFolder}/../../common_firmware/include/**"
            ],
            "forcedInclude": [
                "${workspaceFolder}/nRF5_SDK_16.0.0/config/nrf52840/config/sdk_config.h"    <--- I edited this to reference the .h
            ],
            "defines": [
                "APP_TIMER_V2",
                "APP_TIMER_V2_RTC1_ENABLED",
                "BOARD_CUSTOM",
                "NRF52840_MDK_USB_DONGLE",
                "FLOAT_ABI_HARD",
                "NRF52840_XXAA",
                "NRF_SD_BLE_API_VERSION=6",
                "S340",
                "SOFTDEVICE_PRESENT"
            ],
            "compilerPath": "/usr/bin/arm-none-eabi-gcc",
            "cStandard": "c11",
            "cppStandard": "c++17",
            "intelliSenseMode": "clang-x64"
        }
    ],
    "version": 4
  }
 
gfmoore said:
gfmoore said:
Can I ask a possibly insulting question and apologies in advance, but do the repos actually match what you have on "your" machines? :confused:

Hi, bumping this.

I'm trying very hard to solve these issues but the repos for TSDZ2_wireless/EBike_wireless_TSDZ2 and TSDZ2_wireless/EBike_wireless_remote cannot be matching what you have on your development machines otherwise surely they would build as is.

As an example, I found in the TSDZ2_wireless/EBike_wireless_TSDZ2/firmware directory that I really needed a reference to nRF5_SDK_16.0.0 So which one do I use as there are a number of copies (versions of this around the repo?) I tried the one from TSDZ2_wireless/EBike_wireless_remote/firmware thinking that since you were developing these together they would be ok.

However, they are not, since for EBike_wireless_TSDZ2 there is a reference to pins.h which references boards.h which is found in (my now) TSDZ2_wireless/EBike_wireless_TSDZ2/firmware/nRF5_SDK_16.0.0/components\boards directory.

But this has an error:

Code:
#else
#error "Board is not defined"    <---wavy red lines => problem!

#endif

#ifdef __cplusplus
extern "C" {                 
#endif

This could be some development code that isn't used in the EBike_wireless_remote code and it was my bad luck to have chosen the wrong nRF5_SDK_16.0.0

I'm assuming that those who can build this code do not have any issues?

So again may I respectfully ask if the repos actually match your development systems and if not could they be fixed please as otherwise I am stuck before I can even begin to try and understand and make use of this open source code.

I suspect a good test would be for one of you devs to clone the current repo - TSDZ2_wireless - to some other directory on your machines and see if the projects will build? If it does then I am doing something really stupid in my setup and I apologise in advance.

Gordon.

edit: I'm beginning to suspect that the c_cpp_properties.json under .vscode may be the culrpit. I'm assuming that the nRF5_SDK_16.0.0 code is as provided and that nothing has been done to it?

My c_cpp_properties.json looks like:

Code:
{
    "configurations": [
        {
            "name": "nRF SDK 16.0.0",
            "includePath": [
                "${workspaceFolder}/**",
                "${workspaceFolder}/../../common_firmware/include/**"
            ],
            "forcedInclude": [
                "${workspaceFolder}/nRF5_SDK_16.0.0/config/nrf52840/config/sdk_config.h"    <--- I edited this to reference the .h
            ],
            "defines": [
                "APP_TIMER_V2",
                "APP_TIMER_V2_RTC1_ENABLED",
                "BOARD_CUSTOM",
                "NRF52840_MDK_USB_DONGLE",
                "FLOAT_ABI_HARD",
                "NRF52840_XXAA",
                "NRF_SD_BLE_API_VERSION=6",
                "S340",
                "SOFTDEVICE_PRESENT"
            ],
            "compilerPath": "/usr/bin/arm-none-eabi-gcc",
            "cStandard": "c11",
            "cppStandard": "c++17",
            "intelliSenseMode": "clang-x64"
        }
    ],
    "version": 4
  }

Could this be it: Can I ask where custom_board.h is to be found? for EBike_wireless_TSDZ2? (And nrf52840_mdk_usb_dongle.h)
edit:
Temporarily moved these that I found in a higher level repo ebike_wireless_remote to the EBike_wireless_TSDZ2/firmware and adjusted my c_cpp_properties.json to look in that directory:
Code:
            "includePath": [
                "${workspaceFolder}/**",
                "${workspaceFolder}/../../common_firmware/include/**",
                "${workspaceFolder}/"
            ],
            "forcedInclude": [
                "${workspaceFolder}/nRF5_SDK_16.0.0/config/nrf52840/config/sdk_config.h"
            ],

That sorted that (Temporarily because I have no idea if these are correct headers, but now I have more issues:

In main.c
NRF_SDH_ANT_OBSERVER(m_ant_observer, ANT_LEV_ANT_OBSERVER_PRIO, ant_lev_sens_evt_handler, &m_ant_lev);

and in the problems tab
{
"resource": "/home/gordon/ebike/TSDZ2_wireless/EBike_wireless_TSDZ2/firmware/main.c",
"owner": "C/C++",
"code": "20",
"severity": 8,
"message": "identifier \"NRF_SDH_ANT_ENABLED\" is undefined", <----------
"source": "C/C++",
"startLineNumber": 133,
"startColumn": 1,
"endLineNumber": 133,
"endColumn": 21
}

!!! :(

edit: I'm assuming that the includes I copied are not correct?
 
Whilst waiting for some insights on TSDZ2 code? I thought I'd have a go at the TSDZ2_wireless/EBike_wireless_remote/firmware repo.

Mostly builds, except for:

Code:
Preparing: _build/TSDZ2_wireless_remote.bin
DONE TSDZ2_wireless_remote
nrfutil settings generate --family NRF52840 --application _build/TSDZ2_wireless_remote.hex --application-version-string 0.7.0 --bootloader-version 10 --bl-settings-version 2 _build/bl_settings.hex 
make: nrfutil: Command not found
make: *** [Makefile:305: bl_settings] Error 127
The terminal process "/bin/bash '-c', 'make'" terminated with exit code: 2.

So I do have nrfutil installed on wsl2 Ubuntu:

Code:
gordon@GM-One:~$ nrfutil version       
nrfutil version 6.1.0
(bit of a non standard use of version?? but hey ho)

So looking in makefile at line 305
Code:
$(SREC_PATH)nrfutil settings generate --family NRF52840 --application $(OUTPUT_DIRECTORY)/TSDZ2_wireless_remote.hex --application-version-string $(APP_VER_MAJOR).$(APP_VER_MINOR).0 --bootloader-version 10 --bl-settings-version 2 $(OUTPUT_DIRECTORY)/bl_settings.hex

Cannot find definition for SREC_PATH in Makefile? Is it somewhere else? Where does it point?

Gordon :confused:
Sorry!
 
gfmoore said:
Whilst waiting for some insights on TSDZ2 code? I thought I'd have a go at the TSDZ2_wireless/EBike_wireless_remote/firmware repo.

Mostly builds, except for:

Code:
Preparing: _build/TSDZ2_wireless_remote.bin
DONE TSDZ2_wireless_remote
nrfutil settings generate --family NRF52840 --application _build/TSDZ2_wireless_remote.hex --application-version-string 0.7.0 --bootloader-version 10 --bl-settings-version 2 _build/bl_settings.hex 
make: nrfutil: Command not found
make: *** [Makefile:305: bl_settings] Error 127
The terminal process "/bin/bash '-c', 'make'" terminated with exit code: 2.

So I do have nrfutil installed on wsl2 Ubuntu:

Code:
gordon@GM-One:~$ nrfutil version       
nrfutil version 6.1.0
(bit of a non standard use of version?? but hey ho)

So looking in makefile at line 305
Code:
$(SREC_PATH)nrfutil settings generate --family NRF52840 --application $(OUTPUT_DIRECTORY)/TSDZ2_wireless_remote.hex --application-version-string $(APP_VER_MAJOR).$(APP_VER_MINOR).0 --bootloader-version 10 --bl-settings-version 2 $(OUTPUT_DIRECTORY)/bl_settings.hex

Cannot find definition for SREC_PATH in Makefile? Is it somewhere else? Where does it point?

Gordon :confused:
Sorry!
You wrote a few messages and I am lost on what are your current issues when building, but:
- the configurations of Code Studio are not used on the Makefile, so the build only considers the configurations on the Makefile
- all that tools lie nrfutil or srec, you need to figure out you have working versions of them

All the firmware builds ok on my computer and I see I have no extra files that are not on the repository, so, it should build ok for everyone.
 
Back
Top