Bonjour,

J'essai difficilement de configurer un bootloader pour pouvoir charger mon prog via USB sous harmony v1.07.

J'utilise donc un prog bootloader qui fonctionnait déjà avec un autre programme fait antérieurement, ou je chargeai donc ce programme puis chargeais le .hex du programme principal.

Pour ça, j'ai donc adapter les zones mémoires, tant sur le prog bootloader et le prog principal dans les fichiers linker.

Actuellement, mon prog bootloader ce charge bien et je boot bien dessus pour charger mon prog principal, seulement une fois charger,mon nouveau programme principal ne tourne pas.

j'ai tenté d'utiliser dans mon programme principal mon linker qui fonctionnait sur un autre soft et celui-ci me retourne évidemment des erreurs


Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
MEMORY
{
  Flash_memory               : ORIGIN = 0x9D070000, LENGTH = 10000
  kseg0_program_mem    (rx)  : ORIGIN = (0x9D006000 + 0x1000 + 0x970 + 0x490), 	LENGTH = (0x80000 - 0x6000 - 0x1000 - 0x970 - 0x490-0x10000)
  kseg0_boot_mem             : ORIGIN = (0x9D006000 + 0x1000), 					LENGTH = 0x970
  exception_mem              : ORIGIN =  0x9D006000, 							LENGTH = 0x1000 /* Dummy IVT to fool the linker. This code uses no ISR*/
  kseg1_boot_mem             : ORIGIN = (0x9D006000 + 0x1000 + 0x970), 			LENGTH = 0x490
  debug_exec_mem             : ORIGIN = 0xBFC02000, LENGTH = 0xFF0
  config3                    : ORIGIN = 0xBFC02FF0, LENGTH = 0x4
  config2                    : ORIGIN = 0xBFC02FF4, LENGTH = 0x4
  config1                    : ORIGIN = 0xBFC02FF8, LENGTH = 0x4
  config0                    : ORIGIN = 0xBFC02FFC, LENGTH = 0x4
  kseg1_data_mem       (w!x) : ORIGIN = 0xA0000000, LENGTH = 0x18000
  sfrs                       : ORIGIN = 0xBF800000, LENGTH = 0x10000
  configsfrs                 : ORIGIN = 0xBFC02FF0, LENGTH = 0x10
}


Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
 Link Warning: absolute section '_047ab0c057e3aa5f' crosses the boundary of region kseg0_program_mem.
 Link Error: Could not allocate section '_047ab0c057e3aa5f' at 0x9d000000
 Link Error: Could not allocate program memory
collect2.exe: error: ld returned 255 exit status
make[2]: *** [dist/pic32mx_eth_sk+ioexp+11n+freertos/production/pic32_eth_wifi_web_server.X.production.hex] Error 255
make[1]: *** [.build-conf] Error 2
make: *** [.build-impl] Error 2
nbproject/Makefile-pic32mx_eth_sk+ioexp+11n+freertos.mk:1539: recipe for target 'dist/pic32mx_eth_sk+ioexp+11n+freertos/production/pic32_eth_wifi_web_server.X.production.hex' failed
make[2]: Leaving directory 'C:/Users/Tecwave/disque 1t/etude/hardware/Programme PIC32/WIFI/N V1.2/apps/tcpip/web_server_nvm_mpfs/firmware/pic32_eth_wifi_web_server.X'
nbproject/Makefile-pic32mx_eth_sk+ioexp+11n+freertos.mk:78: recipe for target '.build-conf' failed
make[1]: Leaving directory 'C:/Users/Tecwave/disque 1t/etude/hardware/Programme PIC32/WIFI/N V1.2/apps/tcpip/web_server_nvm_mpfs/firmware/pic32_eth_wifi_web_server.X'
nbproject/Makefile-impl.mk:39: recipe for target '.build-impl' failed

BUILD FAILED (exit value 2, total time: 15s)

Maintenant, j'ai utilisé un autre linker, plus généric celui-là : p32MX795F512L.ld
celui-ci passe très bien dans mon soft principal, seulement pour le moment je n'ai pas modifier la zone mémoire pour l'adapter au bootloader.



Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
MEMORY
{
  kseg0_program_mem     (rx)  : ORIGIN = 0x9D000000, LENGTH = 0x80000
  kseg0_boot_mem              : ORIGIN = 0x9FC00490, LENGTH = 0x970
  exception_mem               : ORIGIN = 0x9FC01000, LENGTH = 0x1000
  kseg1_boot_mem              : ORIGIN = 0xBFC00000, LENGTH = 0x490
  debug_exec_mem              : ORIGIN = 0xBFC02000, LENGTH = 0xFF0
  config3                     : ORIGIN = 0xBFC02FF0, LENGTH = 0x4
  config2                     : ORIGIN = 0xBFC02FF4, LENGTH = 0x4
  config1                     : ORIGIN = 0xBFC02FF8, LENGTH = 0x4
  config0                     : ORIGIN = 0xBFC02FFC, LENGTH = 0x4
  kseg1_data_mem       (w!x)  : ORIGIN = 0xA0000000, LENGTH = 0x20000
  sfrs                        : ORIGIN = 0xBF800000, LENGTH = 0x100000
  configsfrs                  : ORIGIN = 0xBFC02FF0, LENGTH = 0x10
}


Ma première question serait de quel fichier il serai plus simple de partir, celui déjà adapté au fichier boot ou le généric que j'aurai à modifier plus généralement.

dans mon soft, harmony à généré des emplacement mémoire déjà attribué que j'ai modifié pour mon besoin


Code c : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
#define DRV_NVM_MEDIA_SIZE              64
#define DRV_NVM_MEDIA_START_ADDRESS     0x9D000000
#define WDRV_NVM_MY_CONFIG_ADDR       0xE000


j'essai de comprendre comment placer les différentes zone mémoires

sachant que j'ai un server web embarqué ;

mes pages web prennent environ 57ko
mes données sauvegardées prennent 1024

donc au total environ 58ko

puis mon programme prend 483496 octet (max 531ko)

j'ai donc du mal à comprendre comment organiser tout ça

Bootloader.h fonctionnelle


Code c : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
/* Rule: 
 		1)The memory regions kseg0_program_mem, kseg0_boot_mem, exception_mem and 
 		kseg1_boot_mem of the application linker script must fall with in APP_FLASH_BASE_ADDRESS 
 		and APP_FLASH_END_ADDRESS
 		 
 		2)The base address and end address must align on  4K address boundary */
 
#define APP_FLASH_BASE_ADDRESS 	0x9D006000
//#define APP_FLASH_BASE_ADDRESS 	0x9D000000
#define APP_FLASH_END_ADDRESS   PROGRAM_FLASH_END_ADRESS
//#define APP_FLASH_END_ADDRESS   0x9D07FFFF
 
/* Address of  the Flash from where the application starts executing */
/* Rule: Set APP_FLASH_BASE_ADDRESS to _RESET_ADDR value of application linker script*/
 
// For PIC32MX1xx and PIC32MX2xx Controllers only
//#define USER_APP_RESET_ADDRESS 	(0x9D006000 + 0x1000)
#define USER_APP_RESET_ADDRESS 	(0x9D006000 + 0x1000 + 0x970)



Merci pour votre aide