Develop a QCA7000 board?
- johu
- Site Admin
- Posts: 6645
- Joined: Thu Nov 08, 2018 10:52 pm
- Location: Kassel/Germany
- Has thanked: 348 times
- Been thanked: 1506 times
- Contact:
Re: Develop a QCA7000 board?
I started working on PP enable logic.
I modified the power supply. Formerly EN was floating meaning always on. I have now connected a CJ431 reference that will disable the power supply when PP voltage rises above around 3V (can be changed with the resistor values).
To allow for this to work I added an optional PP pull-up to permanent 12V
I tried to use resistor values already used elsewhere. To restore default behaviour R66 must be removed or we add another solder jumper
Next step would be a high-side driver (aka PMOS) that Clara can enable to power up or trigger the other devices needed for charging. And a GPIO to the EN pin (with diode!) so that Clara can control its own power
I modified the power supply. Formerly EN was floating meaning always on. I have now connected a CJ431 reference that will disable the power supply when PP voltage rises above around 3V (can be changed with the resistor values).
To allow for this to work I added an optional PP pull-up to permanent 12V
I tried to use resistor values already used elsewhere. To restore default behaviour R66 must be removed or we add another solder jumper
Next step would be a high-side driver (aka PMOS) that Clara can enable to power up or trigger the other devices needed for charging. And a GPIO to the EN pin (with diode!) so that Clara can control its own power
Support R/D and forum on Patreon: https://patreon.com/openinverter - Subscribe on odysee: https://odysee.com/@openinverter:9
- tom91
- Posts: 2311
- Joined: Fri Mar 01, 2019 9:15 pm
- Location: Bristol
- Has thanked: 200 times
- Been thanked: 535 times
Re: Develop a QCA7000 board?
How would you go about having multiple wake up methods for the power supply? Like a hold from the Micro itself?
- johu
- Site Admin
- Posts: 6645
- Joined: Thu Nov 08, 2018 10:52 pm
- Location: Kassel/Germany
- Has thanked: 348 times
- Been thanked: 1506 times
- Contact:
Re: Develop a QCA7000 board?
Connect a uC pin to EN via a diode. Diode because otherwise the body diodes in the uC would inhibit turn-on. Since EN is pulled up the only thing the micro can do is pull it down, i.e. shut itself off.
Support R/D and forum on Patreon: https://patreon.com/openinverter - Subscribe on odysee: https://odysee.com/@openinverter:9
- celeron55
- Posts: 803
- Joined: Thu Jul 04, 2019 3:04 pm
- Location: Finland
- Has thanked: 38 times
- Been thanked: 135 times
- Contact:
Re: Develop a QCA7000 board?
Is the CAN protocol used to configure and monitor ccs32clara documented anywhere?
I really despise esp32s and wifi and have had so many bad experiences with them (every time I try to use them I get more and more traumatized and days and days are erased from my expected lifespan) that I want to do the configuration using my Linux PC via a CAN adapter. This would entail e.g. a Python script.
An Arduino sketch that implements the protocol could also work.
If nobody knows how the CAN protocol actually works then maybe just add a serial console on the UART that can accept configuration and monitoring commands?
This is currently blocking my use of ccs32clara. I even spent a day with an esp32 and now I am ready to throw all my esp32s in the bin. The esp32 simply isn't something to depend on.
EDIT: It looks like the esp32 project contains a reasonably encapsulated implementation of the protocol and it even should port quite easily to a regular Arduino. I'll spend some time on that next.
https://github.com/jsphuebner/esp32-web ... oi_can.cpp
I really despise esp32s and wifi and have had so many bad experiences with them (every time I try to use them I get more and more traumatized and days and days are erased from my expected lifespan) that I want to do the configuration using my Linux PC via a CAN adapter. This would entail e.g. a Python script.
An Arduino sketch that implements the protocol could also work.
If nobody knows how the CAN protocol actually works then maybe just add a serial console on the UART that can accept configuration and monitoring commands?
This is currently blocking my use of ccs32clara. I even spent a day with an esp32 and now I am ready to throw all my esp32s in the bin. The esp32 simply isn't something to depend on.
EDIT: It looks like the esp32 project contains a reasonably encapsulated implementation of the protocol and it even should port quite easily to a regular Arduino. I'll spend some time on that next.
https://github.com/jsphuebner/esp32-web ... oi_can.cpp
- johu
- Site Admin
- Posts: 6645
- Joined: Thu Nov 08, 2018 10:52 pm
- Location: Kassel/Germany
- Has thanked: 348 times
- Been thanked: 1506 times
- Contact:
Re: Develop a QCA7000 board?
Yes you found it. It's CANopen based and partly documented in the wiki
And theres that viewtopic.php?t=2907
It seems there's some scapegoating going on with the esp32. I recently discovered that a wrong resistor value caused the issue with my esp remote module. Plus there are some known bugs in the firmware and web interface
viewtopic.php?p=67270#p67270
And theres that viewtopic.php?t=2907
It seems there's some scapegoating going on with the esp32. I recently discovered that a wrong resistor value caused the issue with my esp remote module. Plus there are some known bugs in the firmware and web interface
viewtopic.php?p=67270#p67270
Support R/D and forum on Patreon: https://patreon.com/openinverter - Subscribe on odysee: https://odysee.com/@openinverter:9
- uhi22
- Posts: 1091
- Joined: Mon Mar 14, 2022 3:20 pm
- Location: Ingolstadt/Germany
- Has thanked: 195 times
- Been thanked: 607 times
Re: Develop a QCA7000 board?
I feel with you. I summarized my experiences here: viewtopic.php?p=67343#p67343celeron55 wrote: ↑Fri Feb 16, 2024 4:04 am I really despise esp32s and wifi and have had so many bad experiences with them (every time I try to use them I get more and more traumatized and days and days are erased from my expected lifespan) that I want to do the configuration using my Linux PC via a CAN adapter. This would entail e.g. a Python script.
My conclusion is a different: The approach with the web interface is quite good, and starting a different approach would be more effort than fixing the stability issues of the current approach. But I could be wrong, and I fully understand that you do not want to waste your time fighting with this sh***y ESP. Same for me, at least at the moment

Github: http://github.com/uhi22 --- Patreon: https://www.patreon.com/uhi22
- celeron55
- Posts: 803
- Joined: Thu Jul 04, 2019 3:04 pm
- Location: Finland
- Has thanked: 38 times
- Been thanked: 135 times
- Contact:
Re: Develop a QCA7000 board?
Definitely should mention all these options in the ccs32clara user manual:
- ESP32 web interface (currently mentioned as the only option)
- https://github.com/davefiddes/openinverter-can-tool
- Porting the ESP32 web interface CAN code to any Arduino based system (making this even more portable should definitely be a goal)
Is there anything preventing making the configuration interface available via UART, like in most openinverter boards?
- ESP32 web interface (currently mentioned as the only option)
- https://github.com/davefiddes/openinverter-can-tool
- Porting the ESP32 web interface CAN code to any Arduino based system (making this even more portable should definitely be a goal)
Is there anything preventing making the configuration interface available via UART, like in most openinverter boards?
- johu
- Site Admin
- Posts: 6645
- Joined: Thu Nov 08, 2018 10:52 pm
- Location: Kassel/Germany
- Has thanked: 348 times
- Been thanked: 1506 times
- Contact:
Re: Develop a QCA7000 board?
Right now the console is used for excessive logging. With that turned off it's a 1-liner to have the console on that pin. But then what are you going to connect to it that you couldn't also connect to CAN?
Support R/D and forum on Patreon: https://patreon.com/openinverter - Subscribe on odysee: https://odysee.com/@openinverter:9
- celeron55
- Posts: 803
- Joined: Thu Jul 04, 2019 3:04 pm
- Location: Finland
- Has thanked: 38 times
- Been thanked: 135 times
- Contact:
Re: Develop a QCA7000 board?
It is true that if the CAN configuration interface is easy to set up in various environments, there is not much need for UART.
So far, to me, it has not been, but I'm now going to try openinverter-can-tool and see how it goes.
- johu
- Site Admin
- Posts: 6645
- Joined: Thu Nov 08, 2018 10:52 pm
- Location: Kassel/Germany
- Has thanked: 348 times
- Been thanked: 1506 times
- Contact:
Re: Develop a QCA7000 board?
Yes and please pester Dave to implement the CAN mapping

Support R/D and forum on Patreon: https://patreon.com/openinverter - Subscribe on odysee: https://odysee.com/@openinverter:9
- celeron55
- Posts: 803
- Joined: Thu Jul 04, 2019 3:04 pm
- Location: Finland
- Has thanked: 38 times
- Been thanked: 135 times
- Contact:
Re: Develop a QCA7000 board?
I posted about my problems in the OIC thread. The problem could be in ccs32clara too, I don't really have a clue: viewtopic.php?p=67380#p67380
- celeron55
- Posts: 803
- Joined: Thu Jul 04, 2019 3:04 pm
- Location: Finland
- Has thanked: 38 times
- Been thanked: 135 times
- Contact:
Re: Develop a QCA7000 board?
To avoid off-topic in the OIC thread, I'll continue here:
Wait what? I thought I pulled, compiled and flashed the latest clara!
This is supposed to be 0cb9745a3bea0e8171c03f190f38181dfb1a5f1c, and I built it on 9th February, just a week ago. The hex file I used has that date on it.
My OpenOCD script for flashing the firmware looks like this. Is there something wrong with this? Well, it's probably wrong, because the board still has the old firmware.
Wait what? I thought I pulled, compiled and flashed the latest clara!
This is supposed to be 0cb9745a3bea0e8171c03f190f38181dfb1a5f1c, and I built it on 9th February, just a week ago. The hex file I used has that date on it.
My OpenOCD script for flashing the firmware looks like this. Is there something wrong with this? Well, it's probably wrong, because the board still has the old firmware.
Code: Select all
source [find interface/stlink.cfg]
source [find target/stm32f1x.cfg]
init
targets
reset halt
flash write_image erase stm32_canloader.hex 0x08000000
flash write_image erase ../stm32_ccs.hex 0x08001000
reset run
shutdown
- celeron55
- Posts: 803
- Joined: Thu Jul 04, 2019 3:04 pm
- Location: Finland
- Has thanked: 38 times
- Been thanked: 135 times
- Contact:
Re: Develop a QCA7000 board?
Ah the frigging hex files already included the address offset. OpenOCD was trying to flash above 0x10000000 and that's no good. So, this is much better:
EDIT: Now OIC works:
Code: Select all
source [find interface/stlink.cfg]
source [find target/stm32f1x.cfg]
init
targets
reset halt
flash write_image erase stm32_canloader.hex
flash write_image erase ../stm32_ccs.hex
reset run
shutdown
Code: Select all
$ oic -n 22 listparams
udcdivider [dig/V] - min: 0 max: 100 default: 10
economizer [%] - min: 0 max: 100 default: 100
inletvtgsrc [0=ChargerOutput, 1=AnalogInput, 2=CAN] - min: 0 max: 2 default: 0
lockpwm [dig] - min: -100 max: 100 default: 30
lockruntm [ms] - min: 0 max: 10000 default: 1500
lockclosethr [dig] - min: 0 max: 4095 default: 0
lockopenthr [dig] - min: 0 max: 4095 default: 0
tmpsnsnom [Ohm] - min: 1 max: 1e+06 default: 10000
...
- uhi22
- Posts: 1091
- Joined: Mon Mar 14, 2022 3:20 pm
- Location: Ingolstadt/Germany
- Has thanked: 195 times
- Been thanked: 607 times
Re: Develop a QCA7000 board?
Yeah, now it's alive. Congrats 

Github: http://github.com/uhi22 --- Patreon: https://www.patreon.com/uhi22
- celeron55
- Posts: 803
- Joined: Thu Jul 04, 2019 3:04 pm
- Location: Finland
- Has thanked: 38 times
- Been thanked: 135 times
- Contact:
Re: Develop a QCA7000 board?
Here's the CAN log for "oic -n 22 serialno", for future reference. I did censor my serial number, but trust me, it was pretty boring:
Code: Select all
(000.000000) can0 616 [8] 40 00 50 02 00 00 00 00
(000.001659) can0 596 [8] 43 00 50 02 XX XX XX XX
(000.001862) can0 616 [8] 40 00 50 01 00 00 00 00
(000.003666) can0 596 [8] 43 00 50 01 XX XX XX XX
(000.003795) can0 616 [8] 40 00 50 00 00 00 00 00
(000.005767) can0 596 [8] 43 00 50 00 XX XX XX XX
- celeron55
- Posts: 803
- Joined: Thu Jul 04, 2019 3:04 pm
- Location: Finland
- Has thanked: 38 times
- Been thanked: 135 times
- Contact:
Re: Develop a QCA7000 board?
Yeah I think my next problem will be exactly that. Clara is quite useless without CAN mapping.
- johu
- Site Admin
- Posts: 6645
- Joined: Thu Nov 08, 2018 10:52 pm
- Location: Kassel/Germany
- Has thanked: 348 times
- Been thanked: 1506 times
- Contact:
Re: Develop a QCA7000 board?
Now back to the ESP32 with the firmware you already found 

Support R/D and forum on Patreon: https://patreon.com/openinverter - Subscribe on odysee: https://odysee.com/@openinverter:9
- celeron55
- Posts: 803
- Joined: Thu Jul 04, 2019 3:04 pm
- Location: Finland
- Has thanked: 38 times
- Been thanked: 135 times
- Contact:
Re: Develop a QCA7000 board?
I tried it, it works a bit but absolutely sucks. Can mappings don't work at all and the dashboard is blank, and everything is unresponsive and completely confidence destroying. I refuse to use it.
- johu
- Site Admin
- Posts: 6645
- Joined: Thu Nov 08, 2018 10:52 pm
- Location: Kassel/Germany
- Has thanked: 348 times
- Been thanked: 1506 times
- Contact:
Re: Develop a QCA7000 board?
The dashboard is targeted at inverter firmware, forget it. Enter node id 22, refresh the page and you should be good.
Support R/D and forum on Patreon: https://patreon.com/openinverter - Subscribe on odysee: https://odysee.com/@openinverter:9
- celeron55
- Posts: 803
- Joined: Thu Jul 04, 2019 3:04 pm
- Location: Finland
- Has thanked: 38 times
- Been thanked: 135 times
- Contact:
Re: Develop a QCA7000 board?
I would prefer it if the configuration and integration parameters were built into the firmware binary and were unmodifiable at runtime. In my world view, source code is configuration.
The second best option is OIC.
An ESP32 wifi web interface is one of the worst possible options imaginable to me. Stop trying to make me use it, it's awful even at the concept level.
Is there an easy way to set unmodifiable parameters and CAN mappings into ccs32clara at build time?
The second best option is OIC.
An ESP32 wifi web interface is one of the worst possible options imaginable to me. Stop trying to make me use it, it's awful even at the concept level.
Is there an easy way to set unmodifiable parameters and CAN mappings into ccs32clara at build time?
- muehlpower
- Posts: 681
- Joined: Fri Oct 11, 2019 10:51 am
- Location: Germany Fürstenfeldbruck
- Has thanked: 14 times
- Been thanked: 134 times
Re: Develop a QCA7000 board?
How do I get the latest version as a hex file? I can't get the toolchain to compile it myself to work. ( too stupid)
- johu
- Site Admin
- Posts: 6645
- Joined: Thu Nov 08, 2018 10:52 pm
- Location: Kassel/Germany
- Has thanked: 348 times
- Been thanked: 1506 times
- Contact:
Re: Develop a QCA7000 board?
Ok, I remember you use vi for coding, so yes a web interface must be terrifying for you 
You can erase the last flash page, it contains the saved parameters. Then you edit param_prj.h (with vi !) and change the default values to what you need them to be. Then recompile. Option one achieved
What is the most github-ish way to built a binary of every commit or something?

You can erase the last flash page, it contains the saved parameters. Then you edit param_prj.h (with vi !) and change the default values to what you need them to be. Then recompile. Option one achieved

Will draft a random release in a moment, you'll find it here: https://github.com/uhi22/ccs32clara/releasesmuehlpower wrote: ↑Sat Feb 17, 2024 9:25 am How do I get the latest version as a hex file? I can't get the toolchain to compile it myself to work. ( too stupid)
What is the most github-ish way to built a binary of every commit or something?
Support R/D and forum on Patreon: https://patreon.com/openinverter - Subscribe on odysee: https://odysee.com/@openinverter:9
- celeron55
- Posts: 803
- Joined: Thu Jul 04, 2019 3:04 pm
- Location: Finland
- Has thanked: 38 times
- Been thanked: 135 times
- Contact:
Re: Develop a QCA7000 board?
How can I set the CAN mappings?
EDIT: I suppose I can just add a bunch of
Code: Select all
canMap->AddSend();
canMap->AddRecv();
It would be best to have an official place to put user-defined defaults at compile time. I'll see if I'll make a PR about that.
EDIT: And no it's not Vi, it's Vim. I'm modern like that. I can see in Wikipedia that by the time Vim was released in 1991, WaveLAN, the precursor to Wifi already existed!
- johu
- Site Admin
- Posts: 6645
- Joined: Thu Nov 08, 2018 10:52 pm
- Location: Kassel/Germany
- Has thanked: 348 times
- Been thanked: 1506 times
- Contact:
Re: Develop a QCA7000 board?
Two ways:
a) hard code them into main(). E.g. before the while(1) loop you add
123: id, 16: bit position, 8: bit length, 1: gain, 0: offset
b) use cansend
The first 4 bytes are the SDO specific things, the last 4 bytes the data
1st byte says you want to write something
2nd and 3rd byte is index 0x3001 specifying a CAN rx mapping (tx is 0x3000)
4th byte is the subindex and specifies what part of the mapping is contained in the data. So:
1st message specifies you want to map to id 0x102
2nd message specifies Param UID in first two bytes (0x7E0), then bit position (0), then length (1)
3rd message specifies gain in first 3 bytes times divided by 1000 and offset in last byte (all 0 in example because dummy message)
use oic to save the mapping when you're happy
corresponding code: https://github.com/jsphuebner/libopenin ... o.cpp#L353
a) hard code them into main(). E.g. before the while(1) loop you add
Code: Select all
canMap->AddSend(Param::udclimit, 123, 16, 8, 1, 0);
b) use cansend
Code: Select all
cansend can0 616#23.01.30.00.02.01.00.00
cansend can0 616#23.01.30.01.E0.07.00.01
cansend can0 616#23.01.30.02.00.00.00.00
1st byte says you want to write something
2nd and 3rd byte is index 0x3001 specifying a CAN rx mapping (tx is 0x3000)
4th byte is the subindex and specifies what part of the mapping is contained in the data. So:
1st message specifies you want to map to id 0x102
2nd message specifies Param UID in first two bytes (0x7E0), then bit position (0), then length (1)
3rd message specifies gain in first 3 bytes times divided by 1000 and offset in last byte (all 0 in example because dummy message)
use oic to save the mapping when you're happy
corresponding code: https://github.com/jsphuebner/libopenin ... o.cpp#L353
Support R/D and forum on Patreon: https://patreon.com/openinverter - Subscribe on odysee: https://odysee.com/@openinverter:9
- celeron55
- Posts: 803
- Joined: Thu Jul 04, 2019 3:04 pm
- Location: Finland
- Has thanked: 38 times
- Been thanked: 135 times
- Contact:
Re: Develop a QCA7000 board?
Yeah that's what I was probably going to get to next. I can implement this now in OIC now that I can cross check between your explanation and the ESP32 source code.
As long as OIC becomes fully featured, I have no need to mess with the firmware build and no need to complain about ESP32.