Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HF-LPB130 - Upgrade #10

Closed
Charnay opened this issue Mar 2, 2020 · 20 comments
Closed

HF-LPB130 - Upgrade #10

Charnay opened this issue Mar 2, 2020 · 20 comments

Comments

@Charnay
Copy link

Charnay commented Mar 2, 2020

Hello, First of all, many thanks for your involvement,

I doing to try Chacon socket and I found your git to manage it via URL, I think to improve security it's so much better than manage directly by the cloud application..

I encoutered the problem related that I can't upgrade my socket with your bin,
What do you need to develop the fix ?

@ljalves
Copy link
Owner

ljalves commented Mar 2, 2020

Intersting... another user already emailed me about his device not working with this firmware.
Then we discovered that it uses a different module (the LPB130) so I added a warning message on the README.md about this:
https://github.com/ljalves/hfeasy#hfeasy

Is your device this one: http://www.lumitek.cn/en/productsd.php?pid=1094
Check the model on the back sticker. Is it a "SW7201"?
I'm wondering if it is just the FR version or if all the newer products use the LPB130 module.

Anyway, this firmware should work and compile just fine on the LPB130.
I could find out that there are 2 module types: one with 1Mb and other with 2Mb flash.
After discovering which one they used on the device, get the toolchain (arm-none-eabi, available for linux and windows) and the SDK from HF:
http://www.hi-flying.com/download-center-1/software-development-kit-1/download-item-hf-lpx30-hsf-sdk-1mb-2mb
Then compile and test...
If I find one of these modules I'll build the firmware.

By the way, the LPB130 is a newer version of the LPB100 and major differences are:

LPB130 LPB100
CPU ARM Cortex-M4@160MHz ARM Cortex-M3@96MHz
OS mbed FreeRTOS
Flash 1Mb/2Mb/4Mb 2Mb
RAM 352Kb 128Kb

@Charnay
Copy link
Author

Charnay commented Mar 2, 2020 via email

@ljalves
Copy link
Owner

ljalves commented Mar 2, 2020

I looked at the lpb130 SDK docs and the internal webserver doesn't seem to have the same capabilities (add custom pages on code), meaning that the fw will not work as is (mqtt should work fine, but controlling by http will not).

Since lpb100 internal webserver is also pretty limited maybe I'll just code a simple webserver (or find an opensource one online) that will work on both modules.

I already installed the gcc toolchain (has to bee the 2016-q3 version) and SDK - everything seems to compile ok so all I need it to get my hands on one of the new modules...

@Charnay
Copy link
Author

Charnay commented Mar 3, 2020 via email

@ljalves
Copy link
Owner

ljalves commented Mar 3, 2020

Not sure if that's a good idea.
It can happen that I order one and it arrives with the older module (lpb100).

@Charnay
Copy link
Author

Charnay commented Mar 4, 2020

Leave me your address at clement@charnay.cc, hope you're live not too far from france,
I will send you one of my sockets
Thanks

@ljalves
Copy link
Owner

ljalves commented Mar 11, 2020

I now have a LPB130 module in my hands.
Will dump original firmware and start doing some tests.

I'll post here whenever I have a working hfeasy firmware for it.

@ljalves
Copy link
Owner

ljalves commented Mar 15, 2020

An update on supporting this module:
I now have 2 of these modules in my hands: 1 is "bricked" from a wrong flash procedure, the other is working and has the original firmware in it.
I've removed the metal shield from the module expecting to see a flash rom... nothing!
This new module has everything integrated inside 1 single IC (explains why it is cheaper).

The bricked module can't even start the serial bootloader. I've connected the debug port and it spits out an hard fault error:

#E HardFault_Handler                                                           
[Hard Faults Report - all numbers in hex]                                       
R0 = 0x00000000                                                                 
R1 = 0x00000006                                                                 
R2 = 0x00000000                                                                 
R3 = 0x00000000                                                                 
R12 = 0x08001001                                                                
LR [R14] = 0x00001a63                                                           
PC [R15] = 0x080010cc                                                           
PSR = 0x01000000                                                                
PRIMASK = 1, IRQ:Disable                                                        
FAULTMASK = 0x00000000                                                          
BASEPRI = 0x00000000                                                            
CONTROL = 0x00000000                                                            
BFAR = 0xe000ed38                                                               
CFSR = 0x00010000                                                               
HFSR = 0x40000000                                                               
DFSR = 0x00000000                                                               
AFSR = 0x00000000                                                               
SCB_SHCSR = 0x00070000                                                          
                                                                                
                                                                                
[Detail report]                                                                 
APSR Flags: nzcv                                                                
ProcStack:0x00000000 MainStack:0x401107b0                                       
                                                                                
Memory Manage Faults                                                            
MM_FAULT_STAT:0x00                                                              
        IACCVIOL:0x00           IACCVIOL:0x00                                   
        MUNSTKERR:0x00          MSTKERR:0x00                                    
        MLSPERR:0x00            MMARVALID:0x00                                  
Bus Faults                                                                      
BUS_FAULT_STAT:0x00                                                             
        IBUSERR:0x00            PRECISERR:0x00                                  
        IMPRECISERR:0x00        UNSTKERR:0x00                                   
        STKERR:0x00             LSPERR:0x00                                     
        BFARVALID:0x00                                                          
Usage Faults                                                                    
USG_FAULT_STAT:0x01                                                             
        UNDEFINSTR:0x01         INVSTATE:0x00                                   
        INVPC:0x00              UFSR.NOCP:0x00                                  
        UNALIGNED:0x00          DIVBYZERO:0x00                                  
                                                                                
[Report done]                                                                   
Panic...           

Also I don't want to replace the original firmware in the working module before I dump it first.
So, to be able to do that I ordered and I'm now waiting for a new programmer that should support this cpu.

More news once the programmer arrives...

@urbamax
Copy link

urbamax commented Dec 23, 2020

Hi! I got a Chacon Plug with LPB130 too... What's up about the custom firmware...?

@Arut42
Copy link

Arut42 commented May 27, 2021

@ljalves you can't brick these devices ;-)
you can always program a new firmware over Uart 0 (debug Uart)
Just get these Programm from HF => "SingleDnload_V01.00.10_20180307"

I have one of these devices On the Label HF-LPB100-0 but it looks totaly different and inside is a HF-LPB230

@ljalves
Copy link
Owner

ljalves commented Jan 21, 2022

Yes, but we'll never be able to get back to the original FW (no download option)...

I'll upload the FW for the LPB130 devices soon...

@Arut42
Copy link

Arut42 commented Jan 22, 2022

U say u have a second one.
Just download the FW over UART0
In the Bootloader u can use the command => flashinfo
U get all info about the flash chip u need
0x18000000 - 0x18001000 is internal Bootloader u can't write to it
with => upload 0x18001000 0x200000 (start len) len 0x100000 for 1MB flash
u get a full upload of the 2MB flash witch u can download to the brick one ;)

@ljalves
Copy link
Owner

ljalves commented Jan 22, 2022

Interesting... I don't remember seeing any command to get the flash contents.
I'll try again as soon as I can!

@ljalves
Copy link
Owner

ljalves commented Jan 25, 2022

HFEASY 0v11 build for LPB130
HFEASY_LPB130_UPGRADE_0V11.zip

Let me know of any issue...

Edit: for web upgrade. Let me know if you need the file for serial port upgrade.

@ljalves
Copy link
Owner

ljalves commented Jan 26, 2022

Official release available:
https://github.com/ljalves/hfeasy/releases/tag/0v11

Let me know how it works...

@urbamax
Copy link

urbamax commented Jan 26, 2022

First, thank you for your job...!!

But... Can't access to any web page when I try "http:///iweb.html" or "http:///" ...
I'm sure about IP of the product because I gave it a static IP.
I tried with Safari and Chrome.
Chrome's telling me "ERR_CONNECTION_REFUSED"

Can you help me with the procedure to upgrade the firmware please...?

@ljalves
Copy link
Owner

ljalves commented Jan 26, 2022

@urbamax,
Is it a Chacon plug you're trying to update? Weird that you can't access the update page... unless you have updated to latest FW where web update is disabled.

The alternative to webpage update is the UART bootloader method.
SecureCRT is fine and you'll need to solder some wires to access UART1 (the easy accessible uart pins are for UART0):
chacon_lpb130_2

You also need GND, VCC(3V3) and nReload pins (UART0 is not needed):
chacon_lpb130

Flash procedure:
WARNING: NEVER PLUG THE MODULE TO AC WHEN PROGRAMMING

  1. Connect nReload to GND and UART1 to a serial2usb adapter.
  2. Open SecureCRT (or any other terminal program that can send using Xmodem protocol).
  3. Power up the module with 3V3.
  4. At the same time you apply power, quickly hit 'space' several times until you enter bootloader (on SecureCRT).
  5. At the bootloader, select 'S' to send binary.
  6. Send using 'Xmodem' protocol the firmware (HFEASY_SERIAL_UPGRADE_LPB130.bin)
  7. After is done, disconnect the nReload pin from GND (leave floating) and power cycle the device - all should work now.

AGAIN: NEVER plug the device to AC line when doing this procedure. These devices are powered by a transformerless circuit and the GND pin can end up being connected to 230V AC (AC LIVE).
Even after disconnecting the serial adapter, if you plug the module in AC be careful not to touch any wires.

You can do testing after flash by just powering the module with only 3V3 (you may not hear the relay toggle) but all should work fine.

@ljalves
Copy link
Owner

ljalves commented Jan 27, 2022

@ljalves
Copy link
Owner

ljalves commented Jan 30, 2022

LPB130 plugs are now supported. For questions/discussions post here.
Closing issue.

@ljalves ljalves closed this as completed Jan 30, 2022
@shinhoshi57
Copy link

U say u have a second one.
Just download the FW over UART0
In the Bootloader u can use the command => flashinfo
U get all info about the flash chip u need
0x18000000 - 0x18001000 is internal Bootloader u can't write to it
with => upload 0x18001000 0x200000 (start len) len 0x100000 for 1MB flash
u get a full upload of the 2MB flash witch u can download to the brick one ;)

I am not sure how you did that?

We just see the 3 standard commands for:

B Clean All Config
S Program Application
G Run Application

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants