From: Frans S. <fra...@gm...> - 2010-03-01 15:30:44
|
Hi, I found a problem in the usbpicprog windows version which seemed to exist since we moved to libusb-1.0. The problem was that 3 bytes of data were added to every data package while programming. I first thought this might be a problem with libusb-1.0-win32, but it is a difference between mingw and msvc. (I also moved from mingw to msvc 2008 at the same time). The difference is the way this union was being handled: 146typedef union 147{ 148 struct 149 { 150 unsigned cmd:8; /// One of the CMD_ defines above 151 unsigned size:8; /// Size of the datafield 152 unsigned addrU:8; /// The address is devided in 3 bytes, Upper, High and Low 153 unsigned addrH:8; 154 unsigned addrL:8; 155 unsigned blocktype:8; /// The blocktype can be middle, first or last (or first|last) 156 unsigned char dataField[32]; 157 } fields; 158 unsigned char data[38]; 159} UppPackage; msvc added 3 bytes between blocktype and dataField in data[], so I changed it into 144typedef enum 145{ 146 up_cmd, 147 up_size, 148 up_addrL, 149 up_addrH, 150 up_addrU, 151 up_blocktype, 152 up_data 153}UPP_INDEX; 154/** 155 UppPackage is the data header which is sent to the programmer hardware. 156*/ 157typedef struct 158{ 159 /*struct 160 { 161 unsigned cmd:8; /// One of the CMD_ defines above 162 unsigned size:8; /// Size of the datafield 163 unsigned addrU:8; /// The address is devided in 3 bytes, Upper, High and Low 164 unsigned addrH:8; 165 unsigned addrL:8; 166 unsigned blocktype:8; /// The blocktype can be middle, first or last (or first|last) 167 unsigned char dataField[32]; 168 } fields;*/ 169 unsigned char data[38]; 170} UppPackage; The pre-834 versions of usbpicprog are thus completely useless. Also the libusb-1.0 without pthread is out now, so I updated the x86 dll in svn. Francesco, could you build version 834 adm64 with the new libusb-1.0? Frans |