[chirp_devel] Need help with some Baofeng radios
IZ3GME Marco
Wed Oct 1 04:10:36 PDT 2014
Sorry for short answers today ...
I would make memory shifted for all radios, for normal ones there will
be 4 unused bytes at the end of ident field.
_ident_radio must then return always a 12 bytes value.
eg.
MEM_FORMAT = """
#seekto 0x000c;
struct {
lbcd rxfreq[4];
etc.etc.
The communication cycle then became
for i in range(0x0c, 0x180c, 0x10):
_send_block(radio, i - 0x0c, radio.get_mmap()[i:i + 0x10])
_do_status(radio, i)
for writing.
73 de IZ3GME Marco
On 01/10/2014 11:53, Jim Unroe wrote:
> Marco,
>
> It isn't just the lengh of the file. Since the "ident" that is returned
> is written to the .img first and the rest of the radio's memory follows
> it, all of the memory is shifted 4 bytes.
>
> So...
>
> #seekto 0x0B08;
> struct {
> u8 code[5];
> u8 unused[11];
> } pttid[15];
>
> for a "normal" BaoFeng UV-5R style radio would need to be...
>
> #seekto 0x0B0C;
> struct {
> u8 code[5];
> u8 unused[11];
> } pttid[15];
>
> For this "odd" class of UV-6 and UV-8 radios.
>
> I think there is a similar problem when writing to the radio. CHIRP
> currently does this...
>
> # Main block
> for i in range(0x08, 0x1808, 0x10):
> _send_block(radio, i - 0x08, radio.get_mmap()[i:i + 0x10])
> _do_status(radio, i)
>
> It starts a 0x08 (right after the normal 8 byte "ident"). I think it
> would need to start at 0x0C (right after the 12 byte "ident").
>
> Jim
>
> On Wed, Oct 1, 2014 at 4:52 AM, IZ3GME Marco <iz3gme.marco at gmail.com
> <mailto:iz3gme.marco at gmail.com>> wrote:
>
> Just a couple of suggestions:
> - for the communication you can try reading 12 bytes lowering timeout so
> if only 8 are received read will bail out quickly enough
> - i would expand the structure to the longer size to have to deal with
> different sizes only when accessing ident field (i guess ident is only
> used during clone)
>
> my two cents
> 73 de IZ3GME Marco
>
> On 01/10/2014 01:53, Jim Unroe wrote:
> > Hi all,
> >
> > I am working on two issues, #1225 (UV-8) and #1707 (UV-6), that after
> > doing research seems to indicate both issues are caused by the
> same thing.
> >
> > The problem is that after the "magic" is sent to the radio to
> initiate
> > cloaning, the radio returns a 12 byte ident when every other Baofeng
> > radio that I know of returns an 8 byte ident. I have temporarily
> edited
> > the driver to accept 12 bytes and CHIRP downloads from the radio. But
> > since the ident is 4 bytes longer, all of the structures are off
> by 4 bytes.
> >
> > After saving the downloaded data to a .img file, I can use a hex
> editor
> > to remove 4 bytes from the begining of .img file, save it to another
> > name and load it back into CHIRP and it is fine.
> >
> > So I am looking for some help to figure out how to have CHIRP to be
> > tolerant of the 8 byte and 12 byte idents and also 4byte offset data
> > structures.
> >
> > Got any ideas?
> >
> > Thanks,
> > Jim KC9HI
>
>
>
>
> _______________________________________________
> chirp_devel mailing list
> chirp_devel at intrepid.danplanet.com
> http://intrepid.danplanet.com/mailman/listinfo/chirp_devel
> Developer docs: http://chirp.danplanet.com/projects/chirp/wiki/Developers
>
More information about the chirp_devel
mailing list