Devo Loader. Now working Fully

More
28 Oct 2013 15:31 - 03 Dec 2013 14:48 #15079 by SadSack
Devo Loader. Now working Fully was created by SadSack
Well I've found a replacement loader OpenBLT Works great and I can see it being used across Devo range TX if you need it to. Don't have any out put to screen (would be Nice) which honestly can live without.

Now problem I have and need help with re-assigning pins. I've tried and moved USB sense pin C11 > B10. Really not sure if its 100% correct.

So I'm hoping someone could offer help with how to change them or point me somewhere that does show me how?!

Thanks
Last edit: 03 Dec 2013 14:48 by SadSack.

Please Log in or Create an account to join the conversation.

More
28 Oct 2013 16:47 - 03 Dec 2013 14:07 #15082 by SadSack
Replied by SadSack on topic Devo Loader
My edit to move USB sense pin from C11 to B10

From this :
/****************************************************************************************
*   U S B   C O M M U N I C A T I O N   I N T E R F A C E   H O O K   F U N C T I O N S
****************************************************************************************/

#if (BOOT_COM_USB_ENABLE > 0)
/************************************************************************************//**
** \brief     Callback that gets called whenever the USB device should be connected
**            to the USB bus. 
** \param     connect BLT_TRUE to connect and BLT_FALSE to disconnect.
** \return    none.
**
****************************************************************************************/
void UsbConnectHook(blt_bool connect)
{
  static blt_bool initialized = BLT_FALSE;

  /* the connection to the USB bus is typically controlled by software through a digital
   * output. the GPIO pin for this must be configured as such.
   */
  if (initialized == BLT_FALSE)
  {
    /* enable clock for PC11 pin peripheral (GPIOC) */
    RCC->APB2ENR |= (blt_int32u)(0x00000010);
    /* configure DIS (GPIOC11) as open drain digital output */
    /* first reset the configuration */
    GPIOC->CRH &= ~(blt_int32u)((blt_int32u)0xf << 12);
    /* CNF11[1:0] = %01 and MODE11[1:0] = %11 */
    GPIOC->CRH |= (blt_int32u)((blt_int32u)0x7 << 12);
    /* set to initialized as this part only has to be done once after reset */
    initialized = BLT_TRUE;
  }

  /* determine if the USB should be connected or disconnected */
  if (connect == BLT_TRUE)
  {
    /* the GPIO has a pull-up so to connect to the USB bus the pin needs to go low */
    GPIOC->BRR = (blt_int32u)((blt_int32u)0x1 << 11);
  }
  else
  {
    /* the GPIO has a pull-up so to disconnect to the USB bus the pin needs to go high */
    GPIOC->BSRR = (blt_int32u)((blt_int32u)0x1 << 11);
  }
} /*** end of UsbConnect ***/

to this :
/****************************************************************************************
*   U S B   C O M M U N I C A T I O N   I N T E R F A C E   H O O K   F U N C T I O N S
****************************************************************************************/

#if (BOOT_COM_USB_ENABLE > 0)
/************************************************************************************//**
** \brief     Callback that gets called whenever the USB device should be connected
**            to the USB bus. 
** \param     connect BLT_TRUE to connect and BLT_FALSE to disconnect.
** \return    none.
**
****************************************************************************************/
void UsbConnectHook(blt_bool connect)
{
  static blt_bool initialized = BLT_FALSE;

  /* the connection to the USB bus is typically controlled by software through a digital
   * output. the GPIO pin for this must be configured as such.
   */
  if (initialized == BLT_FALSE)
  {
    /* enable clock for PC10 pin peripheral (GPIOB) */
    RCC->APB2ENR |= (blt_int32u)(0x00000008);
    /* configure DIS (GPIOB10) as open drain digital output */
    /* first reset the configuration */
    GPIOB->CRH &= ~(blt_int32u)((blt_int32u)0xf << 8);
    /* CNF11[1:0] = %01 and MODE11[1:0] = %11 */
    GPIOB->CRH |= (blt_int32u)((blt_int32u)0x7 << 8);
    /* set to initialized as this part only has to be done once after reset */
    initialized = BLT_TRUE;
  }

  /* determine if the USB should be connected or disconnected */
  if (connect == BLT_TRUE)
  {
    /* the GPIO has a pull-up so to connect to the USB bus the pin needs to go low */
    GPIOB->BRR = (blt_int32u)((blt_int32u)0x1 << 10);
  }
  else
  {
    /* the GPIO has a pull-up so to disconnect to the USB bus the pin needs to go high */
    GPIOB->BSRR = (blt_int32u)((blt_int32u)0x1 << 10);
  }
} /*** end of UsbConnect ***/

Ok for now
Last edit: 03 Dec 2013 14:07 by SadSack.

Please Log in or Create an account to join the conversation.

More
28 Oct 2013 17:01 - 03 Dec 2013 14:09 #15083 by SadSack
Replied by SadSack on topic Devo Loader
Now if other is correct.
This should be easy :unsure: (yeah right)moving B0 to C9 so it can be used for Backdoor Entry into loader.

Now C9 is using button matrix Row C9 / Column B9 = Ext
/****************************************************************************************
*   B A C K D O O R   E N T R Y   H O O K   F U N C T I O N S
****************************************************************************************/

#if (BOOT_BACKDOOR_HOOKS_ENABLE > 0)
/************************************************************************************//**
** \brief     Initializes the backdoor entry option.
** \return    none.
**
****************************************************************************************/
void BackDoorInitHook(void)
{
  /* enable clock for PA0 pin peripheral (GPIOA) */
  RCC->APB2ENR |= (blt_int32u)(0x00000004);
  /* configure BUT (GPIOA0) as floating digital input */
  /* first reset the configuration */
  GPIOA->CRL &= ~(blt_int32u)((blt_int32u)0xf << 0);
  /* CNF0[1:0] = %01 and MODE0[1:0] = %00 */
  GPIOA->CRL |= (blt_int32u)((blt_int32u)0x4 << 0);
} /*** end of BackDoorInitHook ***/


/************************************************************************************//**
** \brief     Checks if a backdoor entry is requested.
** \return    BLT_TRUE if the backdoor entry is requested, BLT_FALSE otherwise.
**
****************************************************************************************/
blt_bool BackDoorEntryHook(void)
{
  /* button PA0 has a pullup, so will read high by default. enter backdoor only when
   * this button is pressed. this is the case when it reads low */

  if ((GPIOA->IDR & ((blt_int32u)0x01)) == 0)
  {
    return BLT_TRUE;
  }
  return BLT_FALSE;
} /*** end of BackDoorEntryHook ***/
#endif /* BOOT_BACKDOOR_HOOKS_ENABLE > 0 */

Unfortunately I just can't understand or get lucky with this :blink:

Well I read the manual and got backdoor working using button matrix.
Last edit: 03 Dec 2013 14:09 by SadSack.

Please Log in or Create an account to join the conversation.

More
29 Oct 2013 10:28 - 03 Dec 2013 14:10 #15118 by SadSack
Replied by SadSack on topic Devo Loader
really is it that hard? Rather learn if possible.

Ans:

yes it is that hard for me anyways :-) but got it done
Last edit: 03 Dec 2013 14:10 by SadSack.

Please Log in or Create an account to join the conversation.

More
30 Oct 2013 15:22 #15144 by victzh
Replied by victzh on topic Devo Loader
What's wrong with the standard Devo bootloader?

Please Log in or Create an account to join the conversation.

More
30 Oct 2013 15:26 #15145 by FDR
Replied by FDR on topic Devo Loader
I guess the problem is that it has been cleared.

PB has the one for the DEVO 8 for sure, but he is absent...

Please Log in or Create an account to join the conversation.

More
30 Oct 2013 15:41 #15146 by SadSack
Replied by SadSack on topic Devo Loader
yup i did clear it without thinking. Well it works/simple, one button click and your done. My biggest problem I just don't understand how to re-assign pins on Arm mcu.

Please Log in or Create an account to join the conversation.

  • rbe2012
  • rbe2012's Avatar
  • Offline
  • So much to do, so little time...
More
02 Nov 2013 16:04 #15252 by rbe2012
Replied by rbe2012 on topic Devo Loader
It looks interesting but not for me until I deleted the bootloader of one on my tx...

I took a very short look in the code trying to help you understand the way ports are used (and changed). It is obvious that they are controlled by a few registers like GPIOA->CRL, GPIOB->CRH, ..->BRR and ..->BSRR, but I have not found the correct *.h-file where those names are defined.
Usually the registers are organized in bits where bit0 represents the GPIO-line 0 of the corresponding port (GPIOB bit3 = PB3).
Because the loader is constructed for many MCUs it has an abstraction layer what makes it easy to program (because names are equal for every MCU) but without the translation table (usually a MCU-NAME.h-header-file containing a lot of #define-directives) I can not tell you which of the registers GPIOn->XXX is used for what purpose.

If you point me to the header file I could tell you more.

Please Log in or Create an account to join the conversation.

More
04 Nov 2013 16:26 - 04 Nov 2013 16:27 #15337 by SadSack
Replied by SadSack on topic Devo Loader
Hey thanks for looking.

Well I somehow managed to read Reference manual while reading few different sites and using programmers calculator. You guys got a number system for everything!!! :blink: Just setting pin to function so long winded. Still I can see why it's good thing and being able to move peripheral to another port/pin is exciting, No? And useful to us....
I've got it all going apart from button matrix, so back door can be used and pretty sure I know what I did wrong and how to fix it! So I have working loader which with minor changes will work for all the Tx. There are other things that could make life simpler but hey another day...

Now only thing left for me to learn is using screen. Now I've dropped lucky in that u8glib has Arm version so with a lot of luck could be possible. Well I used that before to help get my OLED work with deviation, so fingers crossed.
Last edit: 04 Nov 2013 16:27 by SadSack.

Please Log in or Create an account to join the conversation.

More
09 Nov 2013 13:42 #15472 by SadSack
Replied by SadSack on topic Devo Loader
Well loader is work fine now, Happy days.
No screen output :blush: Think the best I can manage would be to switch on screen back light and Windows will tell you good to go as well.

Would anyone help me with next tweak. This loader uses 'SREC' and I can use 'OBJCOPY -Osrec devo7e.elf devo7e.srec' would I be able to add this to make file ?

Please Log in or Create an account to join the conversation.

More
03 Dec 2013 14:47 #16230 by SadSack
Replied by SadSack on topic Devo Loader Now working fully!!
Update:

Well I have it working, just not all together at once. What that means is if I disconnect Flash and power up hold 'Ext' like you would to put it DFU mode. Use Microboot to load update that completes and jumps to Deviation and screen works but only dialog box's, no flash connected. Now when i reconnect update as before jumps to Deviation but screen does not work at all and can't be sure Deviation is running. And when i re-power system loader start up, which tells me theres no valid program.

Now if i do that all again but while its loading update I hold 'Ent' button and update completes it just to Deviation and screen lights up with USB logo and i can use flash, format load files what not. Then I press 'Ent' to go to main screen and it goes blank. And when I re-power again back to the loader again no valid program.



Well while I was putting this all together I thought why not zip up what I have. Well you could knock me down with a feather It Works!! What changed? well it wasn't my typing but I did compile deviation using sbstnp VM Odd but I'll take it :woohoo:

Maybe this can help towards memory problems for devo7e.

Please Log in or Create an account to join the conversation.

More
03 Dec 2013 18:54 - 03 Dec 2013 19:29 #16236 by blackmoon
Replied by blackmoon on topic Devo Loader. Now working Fully
Nice Sadsack :D

If I knew I wouldn't have spent the all weekend searching for a suitable BL :p

How large is the BL ?

I was under the impression that openblt was like 24kb (but now I see that it's maybe with all the options usb, serial...).


Which files did you modify on the deviation source to make it reserve space for the BL's checksum location .

Was it "\src\libopencm3\lib\cm3\vector.h and vector.c" ?

The .elf file is unencrypted isn't it ?
Last edit: 03 Dec 2013 19:29 by blackmoon.

Please Log in or Create an account to join the conversation.

More
03 Dec 2013 19:45 #16239 by victzh
Replied by victzh on topic Devo Loader Now working fully!!
How large is this bootloader? And can you provide us with the source?

Please Log in or Create an account to join the conversation.

More
03 Dec 2013 19:56 - 03 Dec 2013 20:03 #16241 by blackmoon
Replied by blackmoon on topic Devo Loader. Now working Fully
It is the OpenBLT bootloader.

feaser.com/openblt/doku.php?id=homepage

It isn't the same as walkera (but who knows, maybe they used this one...)it just a way to convert old transmitters to devention.

I'll be converting a Wk-2602, with one of these boards, they have a stm32F103VET6 so I could load Devo10 (maybe the devo8 with a patch for the 2 pots that the 2602 has) firmware.

dx.com/p/stm32-core103v-cortex-m3-stm32f...lopment-board-150550

dx.com/p/port103v-stm32f103vet6-arm-cort...nt-core-board-148526

dx.com/p/stm32-mcu-arm-cortex-m3-stm32f1...lopment-board-150993
Last edit: 03 Dec 2013 20:03 by blackmoon.

Please Log in or Create an account to join the conversation.

More
03 Dec 2013 20:06 #16242 by PhracturedBlue
Replied by PhracturedBlue on topic Devo Loader. Now working Fully
Walkera uses a modified version of the official STM32 bootloader. It used to be easily available on the stm32 downloads page, but I can't find it anymore.

Please Log in or Create an account to join the conversation.

More
03 Dec 2013 20:31 - 03 Dec 2013 21:27 #16244 by blackmoon
Replied by blackmoon on topic Devo Loader. Now working Fully
Didn't knew that obviously.

Is STM32 BL open source ?

Yeah I wish, I know :p
Last edit: 03 Dec 2013 21:27 by blackmoon.

Please Log in or Create an account to join the conversation.

More
03 Dec 2013 21:46 #16247 by PhracturedBlue
Replied by PhracturedBlue on topic Devo Loader. Now working Fully

blackmoon wrote: Didn't knew that obviously.

Is STM32 BL open source ?

Yeah I wish, I know :p

STM has a rather unclear license, but the code is (or at least was) available and may be modified without permission.

Please Log in or Create an account to join the conversation.

More
03 Dec 2013 22:14 - 04 Dec 2013 15:52 #16250 by SadSack
Replied by SadSack on topic Devo Loader. Now working Fully
99% sure this is Opensource code. And I've got working but rather you eyes over what I did, to be sure.

Think the code used for USB loader is 8K but can be used via Serial port. can use sd and flash.

I've tried to upload what I've done but 11meg I'm guessing is to big, Ill break it down to smaller chucks..

OpenBLT
Last edit: 04 Dec 2013 15:52 by SadSack.

Please Log in or Create an account to join the conversation.

More
03 Dec 2013 22:30 #16251 by blackmoon
Replied by blackmoon on topic Devo Loader. Now working Fully
No need to post the all tree source, only the relevant changed files.

Did you use the VM to compile the bootloader to ?

Please Log in or Create an account to join the conversation.

More
03 Dec 2013 23:11 #16252 by victzh
Replied by victzh on topic Devo Loader. Now working Fully
For serial port you don't need an extra bootloader - they have one in system memory and you need only to set BOOT pins accordingly.

You must have programmed your own hook function, that's the only needed part. It should take much less than 11MB, I'd be surprised if it's 11KB, so you can attach it here.

Please Log in or Create an account to join the conversation.

Time to create page: 0.072 seconds
Powered by Kunena Forum