After you add the line intel_scu_ipc_iowrite8(0x52, 31) how are you compiling this? Are you using bitbake, make, gcc.. ?
Have you tried by changing the ret = intel_scu_pmic_iowrite(..,..) and ret = intel_scu_pmic_ioread(..,..) in the file without adding anything just changing these lines? You could find these lines under the static ssize_t pmic_ops_store()
I'm using BitBake.
I saw these lines in the function "pmic_ops_store()", but I have no idea what I should change there:
they are iterating over an array passed to that function (not just a simple call to "intel_scu_ipc_iowrite8" where I could just change the arguments).
So could you please advice which exact change you would recommend there?
So, let me try to finalize my understanding of the RTC backup battery control register change since I also intend to use an 11maH Li rechargeable coin cell battery for the RTC and require the same settings as Andreas. Do I understand correctly that there is no other way to change register contents than to undertake the rather extensive task (for a complete newby) to modify and recompile and then reflash the Linux kernel?
absolutely, I also really don't understand why we need to recompile the kernel and build the whole image (takes over 6 hours without preparations!) just for a setting change!
It really would be very interesting why Intel did not make the life of us developers much easier and just provided a small command line utility to accomplish this setting change...
But if you need exactly the same settings than me I'm happy to provide you with the ready image as soon as I get it done.
@Charlie: any news on an example including location in the code on how to accomplish this change?
Best regards and thanks
Hello Charlie again,
I now additionally tried to add the code line
as last line directly before the "return size;" statement into the function "pmic_ops_store()" (I thought I just overwrite it again as soon as this register is set for testing if it works at all) and I even could compile successfully with that.
Then I flashed this image to the Edison which also worked without problems.
But unfortunately the setting did not change!
I just measured the voltage and it was still 2.5 V instead of 3.3 V.
So could you please check if my setting "31" is correct for 3.3 V with 500 µA?
I just want to make sure I didn't do a mistake by converting the bits to this decimal number in the first place.
And still it would be really great if someone could provide an example code:
I can't believe that I'm the first one who needs to change this setting...
Best regards and thanks in advance
Thank you. The Panasonic ML-920S/DN 11mAh coin cell I'm using has an optimum charge voltage of 3.1 volts although 3.3 would still probably be OK, they're concern is voltages getting up near 4 volts, which could result in cell damage.
So, hex 31 maps to 00110001
D5 = 1 Only the battery charging function within the main battery charger IC will be disabled when the Charger IC disable pin is asserted.
D4,3 = 10 backup supply charger current 100uA
D2,1 = 00 backup supply charging limit 2.5 volts (so that's why the voltage didn't change)
D0 = 1 enable charging of backup supply
If you want to keep the Charger IC disable pin you chose, then
for 500uA and 3.3 volts,
the bit pattern is 00111111 which maps to
the bit pattern for 500uA charge and 3.15 volts is 00111101 which maps to
and, if you didn't intend to change the default setting of the Charger IC disable pin from its default value of 0
3F hex becomes 1F hex and
3D hex becomes 1D hex.
first thanks for your reply - any help is very appreciated!
But to be honest your reply confuses me a bit:
if I get you right - please correct me if I'm wrong - you come to the conclusion that - if I don't want to change the D5 "Charger IC PIN" (which I don't want) - a value of 1F in HEX is correct, right?
And if I'm not completely confused now, 1F in HEX = 31 in decimal, isn't it?
So my 31 should be correct and it has to work with the value I used, right?
... and 31 in decimal = 1F in HEX = 11111 in binary?
I plan to use the "Panasonic VL2330-1HFE" 50 mA coin cell by the way which may be charged at up to 3.4 V according this (German) website:
Best regards and looking forward to your reply
I might also increase the mAh rating of my backup battery and I think that 3.3 volts is fine.
I was under the impression that the hex value is what is passed to the control register, not decimal.
If I look at the example given on page 38 of the Intel Edison Compute Module Hardware Guide, the value 19, when interpreted as a hex value,
maps to the bit image 00011001
which is 500uA and 2.5 volts
The Guide also points out that bits D7,6,5 should remain as 0
So, for the 3.3 volt and 500uA charge, the hex value is
1F and the hex value is what is normally written to and read from registers
I don't think you need the decimal value, but for a hex value of 1F, the decimal value is 31 ... the fact that the charge voltage remained at 2.5 volts indicates that the "31" you entered was interpreted as a hex value, not a decimal.
So, again, 1F is the value which needs to be loaded into the register ..
first thanks again for your very quick reply!
OK, using HEX value then, but I'm a bit confused in this case how I need to passed that as argument:
as far as I know HEX values are written with "0x" in the beginning, just like as the address "0x52" of the register. Therefore I used "31" (without "0x") to be interpreted as decimal and would have expected that this is identical to "0x1F".
But you would suggest then to try this, right?
Is that correct?
I ran this test in the meantime and compiled everything again (if all is set up and you only do a code change, it takes "only" about 30-45 mins. to recompile and build the new image) with the code line
but unfortunately with a very disappointing result:
no voltage change at all, I still measure 2.486 V at the battery backup connection.
So that's obviously either not the correct setting or (what I think more) not the correct place to add this line of code - I've tried it with these two places:
at the beginning of the "pmic_rpmsg_init" and at the end (before "return", of course) of the "pmic_ops_store" function - both with no effect!
so please, let us know what we need to do to change this setting?
Where we need to put this line of code or do any other change?