Hello Edison Community,
I have been burning the midnight oil trying to change the charging voltage and current on the V_VBAT_BKUP pin of the Edison. I have found lots of great resources, but there seems to be some missing information that I need. I am an engineer, and not much of a programmer, but I have experience with Linux, BASH scripts, Python, and a little more. I have been diligently reading all the Yocto and Bitbake documentation, and have come to understand a fair bit... however not enough to get this figured out. So, any help here pointing me in the right direction will be deeply appreciated.
I tried to modify the bbapend in the meta-yocto-bsp directory, place the patch in a subdirectory named "files", but nothing changed in the build. My bet is if I keep poking around with the various .bbappend files in the poky directory I might find one that works?
So, bottom line is I can't get this to work.
Discussion on Intel's http://www.intel.com/content/www/us/en/support/boards-and-kits/intel-edison-boards/000016246.html Change V_VBAT_BKUP Configuration on an Intel® Edison Board procedure:
Intel provided a patch here to apply as well. Again, the instructions are to modify the 'linux_yocto_3.10.bbappend' file. They specify exactly where that file should be: /meta-intel-edison/meta-intel-edison-bsp/recipes-kernel/linux/... but as you can see from my list of possible .bbappend files from above, there is not one in this directory. So, perhaps my next step should be to create a .bbappend file in that directory and see what happens??? The procedure suggest it should already be in existence, and again the .bbappend shows the 'upstream_to_edison.patch' which does not seem to exist.
Feeling like I've hit all dead ends here. Please shine some light on the path forward. I will keep beating my head against the brick wall in the mean time.
Thank you for contacting us.
Just to clarify, any kernel or image changes are beyond of our support scope. But, we always try our best to help the community.
Having said that, I will investigate more about this, and I will contact you if I have updates about this.
Have a nice day.
Leonardo- Thanks! If you can just point me in the right direction it would help. I keep chiseling away at this problem. I can tell you 100 things that don't work.
That's awesome! We were working on this too, but it is good to know that you solved it.
Feel free to post the solution, it will be very helpful for the community.
Have a nice day.
Leonardo and Edison Community-
I'm working on documenting all I learned today for my own internal uses, and as I said want to share the solution here as well. Since I'm not a programmer this took me a long time, and I learned a ton. I'm a little unsure about how much detail is useful to everyone, but I will do my best. If the detail is insufficient try contacting me, and I will try to do better.
Ultimately the fix was supper simple, and I am somewhat embarrassed that I posted an entire page write-up about it.
I used the patch listed in my original post, bullet point 3. This allows the V_VBAT_BKUP register to be set to different values using a file. Please see the post for complete details. This is going to be very useful for development and I can work it into production too.
In summary: A programmer by the name bbrotherton created the initial patch, however his patch has lots of config changes I don't need (or want probably). A fellow named Andreas (who goes by ab-tools), and Intel employee Charlie (Cmata_Intel) both posted versions of the patch in the forum that were stripped of extra content. Andreas' patch does not work however with the most recent Edison firmware (201606061707), therefore I used the patch file posted by Charlie. That patch was called "pmic_backup_battery.patch.zip"
Caution: Every time power is cycled on the Edison this patch causes V_VBAT_BKUP to default to 0x01 (10uA at 2.5V and enabled)... so, you should include in your startup shell script the command to set this to the desired value for your application. (i.e. echo 31 > /sys/devices/platform/pmic_ccsm/backup_battery_charge)
To Apply the Patch:
To use this patch with the current Edison firmware build I modified the file linux-externalsrc.bb at this directory location:
At line 12 (or 13 in this example) of linux-externalsrc.bb I added SRC_URI += "file://pmic_backup_battery.patch" . So the file reads like this:
LICENSE = "GPLv2"
LIC_FILES_CHKSUM = "file://COPYING;md5=d7810fab7487fb0aad327b76f1be7cd7"
# Allows to avoid fetching, unpacking and patching, since our code is already cloned by repo
# inherit externalsrc
SRC_URI = "git://github.com/01org/edison-linux.git;protocol=https;branch=edison-3.10.98"
SRCREV = "edison-3.10.98"
# Add the line below.
SRC_URI += "file://pmic_backup_battery.patch"
Next I created a subdirectory in the same directory listed above named "files", and moved the unzipped patch file (pmic_backup_battery.patch) into that files directory. Just like Intel's support document says http://www.intel.com/content/www/us/en/support/boards-and-kits/intel-edison-boards/000016246.html here.
Then I compiled, and it worked! (After I fixed a few more errors that bitbake threw completely unrelated to this. )
Note, I ended up doing this with a clean build environment (no previous builds or sources fetched). Intel's support document that I just referenced (and referenced in original post bullet point 4) suggests running the following two commands if you are applying this to source that has been previously complied:
bitbake virtual/kernel –c cleanall
In theory that should work, but I did not use this.
Okay, so much more I could add about how I discovered this, why it works, how bitbake works... but hopefully this is enough to help out someone else.
Take Care All!
That's an excellent reply, thank you so much! It definitely will be very useful for the community.
We really appreciate your participation in the community.
Have a nice day.