-
-
Notifications
You must be signed in to change notification settings - Fork 61
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
Issues using libretuya on BK7231N #33
Comments
Hm, right, apparently your BK7231N is a bit different (they can have different internals) and it's incompatible with ltchiptool. I'll have to fix it. About hid_download_py, there are two problems:
I always say it and I'll say it again (so that more people see it):
In your case, hid download or BkWriter are the only options (for the time being), because apparently bktools has a bug. Try to run bktools manually in writing mode, and report here what it outputs. |
Amazing, worked immediately. Thank you! I've read a lot of documentation over the last couple of days while working on this, I guess I got myself confused. Thanks for your help! Looks like remote_transmitter is working, but remote_receiver is not. I'm debugging now,
yeah serial log confirmed the setup is running correctly, looks like the remote_receiver loop function is exiting early because of this check: auto &s = this->store_;
const uint32_t write_at = s.buffer_write_at;
const uint32_t dist = (s.buffer_size + write_at - s.buffer_read_at) % s.buffer_size;
// signals must at least one rising and one leading edge
if (dist <= 1)
return; looks like this->pin_->attach_interrupt(RemoteReceiverComponentStore::gpio_intr, &this->store_, gpio::INTERRUPT_ANY_EDGE); are there any known issues with attaching interrupts? |
Yes, BK7231 doesn't support "any edge" interrupts, as far as I know. |
Ah, yeah that explains it. I can't find a datasheet for this chip, do you know of one? |
There is no datasheet. The only thing is a chinese PDF with pinouts, etc. No register maps or anything of sorts. |
Ah... rip. Alright, I guess I'll try to modify the remote_receiver so that it toggles the interrupt type from within the ISR |
@catalin2402's change works for me! I made a new copy of the |
It would help to resolve the original issue if you could post the output of running bktools manually in writing mode (optionally even enabling verbose mode). |
I ended up using hid_download because I already had it set up. Does bktools work on linux? From the documentation you linked above I only see an exe download |
Yes, of course it does, it's a python tool. Don't confuse bk7231tools with BkWriter - these are different programs. You can simply install bk7231tools using pip. |
Following up on my last post here. Good point about uploading @kuba2k2, I should have mentioned that in my last comment. I can neither flash from pio nor using the manual method.
Both
ltchiptool uf2 upload firmware.uf2 uart /dev/ttyACM0
andpython -m esphome upload <path to yaml>
give the same error:I've only been able to successfully (at least, on paper) flash with command:
python ~/repos/hid_download_py/uartprogram -w firmware.bin -u -s 0x00 -d /dev/ttyACM0
using hid_download_py
Do you think the flashing process is what's preventing it from working? When I use the latter command to restore the stock firmware (which I also backed up with this tool), it does go back to working properly.
The text was updated successfully, but these errors were encountered: