Code Monkey home page Code Monkey logo

Comments (9)

vendelin8 avatar vendelin8 commented on August 23, 2024

I tried it, and I couldn't flash it. I always get Operation failed. I'm building a zip with adafruit-nrfutil. I tried many different parameter sets. At the end I tried yours that are in DS-D6-micropython1.10-blerepl.zip, as I was able to flash that lately. They are quite weird though. Your --sd-req 0xFFFE doesn't match any SD I've seen. Same for dev revision. So I ended up with dfu genpkg --application blink1.hex --sd-req 0xFFFE --dev-type 0x52 --dev-revision 44463 blink1.zip but it had Operation failed too. My manifest differed only in application bin and dat name, and crc. Same device, same BL+SD. I tried to google the error message, some thread told me to sign the package, but I didn't want to, and it should work without that. Can you please help?

from ds-d6.

fanoush avatar fanoush commented on August 23, 2024

I don't think there is anything special, see usage https://github.com/adafruit/Adafruit_nRF52_nrfutil#usage

No --sd-req or --dev-revision needed. 0xfffe means 'any' and is default when not provided.

from ds-d6.

fanoush avatar fanoush commented on August 23, 2024

as for the code it looks like good start but it can fail for many other reasons like linker script or softdevice configuration (eg. requiring 32kHz crystal which is not there in ds-d6)

from ds-d6.

vendelin8 avatar vendelin8 commented on August 23, 2024

Thanks. I removed those, and I could flash it. And thanks for noting that there's no 32kHz crystal in it, I changed the machine code with this.
So far: bluetooth seems to work. I could reflash it. It surprised me, the SD kept the AdaDFU as a device, and another one Vibry showed up that I initialized from my code. Vibration works, but 5 ms was too small, 20 is noticeable. And it went to bootloader mode after 20 seconds. So far so good. Thanks for all your help.

from ds-d6.

vendelin8 avatar vendelin8 commented on August 23, 2024

I got it unresponsable :-\ But I'm not into the hardware part. I tried to read your guides and other sources, but I'm still very uncertain.
Basically, it has adafruit bootloader, so if the battery goes down, at charge start I have 3 seconds to serial dfu, right? What kind of cable is that, and how do I connect it to a computer? Is it USB to TTL Serial cable? That goes to another microcontroller? Eg. I have a digispark around, and some rPi like boards. Please help.

from ds-d6.

fanoush avatar fanoush commented on August 23, 2024

Yes that happens sooner or later :-) yes tou need usb to ttl serial cable - something based on cp2104 or cp2102 or Ch341 or anything like that from ebay/aliexpress
and then use adafruit-nrfutil dfu serial as described in https://github.com/fanoush/ds-d6/wiki/DFU-update#serial-dfu-procedure , however with adafruit bootloader you don't change speed to 38400, you keep default 115200.

One can prevent that by using watchdog in the code and enter DFU as a first thing in the code when watchdog reset reason is detected at startup.

Also the adafruit bootloader could be modified to do that - it is quite old, today I would add few things to it to make it more brick proof. You can also try to touch button after you put it on charger but most probably it won't work as it is touch and not physical button so it takes some time to register the touch. To more recent bootloaders I have added vibration+wait 300ms for button touch when put on charger with dead battery.

BTW it is also relatively easy to open (see the trick here https://youtu.be/3gjmEdEDJ5A?t=1418 but I'd use something plastic or wooden as a lever to not scratch it) and then you need some swd adapter like stlink v2 clone - even raspbery pi or raspberry pico or esp32 can do that over two wires with right software.

from ds-d6.

vendelin8 avatar vendelin8 commented on August 23, 2024

I'll receive the parts soon, so just to make sure. I bought a USB A female connector that I can put between the ds-d6 and the ttl-serial chip. The two side cables of the usb are gnd and vcc. But are the middle ones tx and rx, so I don't have to open it actually, just put in the usb female, and connect all 4 wires to my ttl-serial converter. Right?

from ds-d6.

vendelin8 avatar vendelin8 commented on August 23, 2024

After I get it back, I plan to play around with it. When I'm ready, I'll add ds-d6 to tinygo, and make a PR to you repo with some demo code too. If you're okay with that. And BTW, how do you know that it doesn't have a 32kHz crystal? As far as I've read, it's inside nrf52832, which is the core of ds-d6.

from ds-d6.

fanoush avatar fanoush commented on August 23, 2024

just put in the usb female, and connect all 4 wires to my ttl-serial converter. Right?

yes, see https://github.com/fanoush/ds-d6/wiki/DFU-update#serial-dfu-procedure
at worst I mixed the rx/tx pins, not sure really

as for external 32kHz crystal - it is optional component and is simply not visible anywhere on the board, also I verified that softdevice initialization will fail if you select 32kHz crystal as clock source

As far as I've read, it's inside nrf52832

No, see the top left corner of schematics at https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.nrf52832.ps.v1.1/ref_circuitry.html?cp=4_2_0_52_0#schematic_qfn48_ldo

There is internal RC oscillator which is less precise and needs calibration every few seconds, more info also here https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.nrf52832.ps.v1.1/clock.html?cp=4_2_0_18_1#concept_xkj_np1_2r
calibration is configured via CTIV register

from ds-d6.

Related Issues (16)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.