Commit Graph

10368 Commits (29c7b34dfaedef907dc9a12655466cc1525dcf19)

Author SHA1 Message Date
0x6d61726b 29c7b34dfa LPC176X flash_api.h implementation
For LPC176X (LPC1768/LPC1769) the flash driver has been implemented according to the CMSIS-PACK Keil.LPC1700_DFP.2.3.0 driver with the following changes in FlashPrg.c:
1. EraseChip() function removed (not used by flash_api)
2. Clock reconfiguration removed and clock value taken from function parameter to avoid unexpected behavior.

Full patch of FlashPrg.c:
--- Keil.LPC1700_DFP.2.3.0\Flash\LPC_IAP\FlashPrg_orig.c	2016-12-08 13:10:10.000000000 +0200
+++ Keil.LPC1700_DFP.2.3.0\Flash\LPC_IAP\FlashPrg.c	2017-04-11 20:02:37.000000000 +0200
@@ -191,90 +191,15 @@
  *                    fnc:  Function Code (1 - Erase, 2 - Program, 3 - Verify)
  *    Return Value:   0 - OK,  1 - Failed
  */
 
 int Init (unsigned long adr, unsigned long clk, unsigned long fnc) {
 
-#if defined LPC1XXX  || defined LPC11U6X
-  CCLK       = 12000;                          // 12MHz Internal RC Oscillator
+	CCLK = clk / 1000;                           // CCLK value is in kHz, clk in Hz
 
-  MAINCLKSEL = 0;                              // Select Internal RC Oscillator
-  MAINCLKUEN = 1;                              // Update Main Clock Source
-  MAINCLKUEN = 0;                              // Toggle Update Register
-  MAINCLKUEN = 1;
-//  while (!(MAINCLKUEN & 1));                   // Wait until updated
-  MAINCLKDIV = 1;                              // Set Main Clock divider to 1
-
-  MEMMAP     = 0x02;                           // User Flash Mode
-#endif
-
-#ifdef LPC17XX
-  IAP.stat =  0;                               // Note: Some Bootloader versions don't set the status if this command is executed
-  IAP.cmd  = 54;                               // Read Part ID
-  IAP_Call (&IAP.cmd, &IAP.stat);              // Call IAP Command
-  if (IAP.stat) return (1);                    // Command Failed
-
-  switch ((IAP.res[0] >> 24) & 0xFF) {
-    case 0x25:
-                                               // Part ID LPC1759 = 0x25113737
-                                               // Part ID LPC1758 = 0x25013F37
-                                               // Part ID LPC1756 = 0x25011723
-                                               // Part ID LPC1754 = 0x25011722
-                                               // Part ID LPC1752 = 0x25001121
-                                               // Part ID LPC1751 = 0x25001118 / 0x25001110
-    case 0x26:
-                                               // Part ID LPC1769 = 0x26113F37
-                                               // Part ID LPC1768 = 0x26013F37
-                                               // Part ID LPC1767 = 0x26012837
-                                               // Part ID LPC1766 = 0x26013F33
-                                               // Part ID LPC1765 = 0x26013733
-                                               // Part ID LPC1764 = 0x26011922
-      CCLK  =  4000;                           //  4MHz Internal RC Oscillator
-      break;
-    case 0x27:
-                                               // Part ID LPC1778 = 0x27193F47
-                                               // Part ID LPC1777 = 0x27193747
-                                               // Part ID LPC1776 = 0x27191F43
-                                               // Part ID LPC1774 = 0x27011132
-                                               // Part ID LPC1772 = 0x27011121
-    case 0x20:  // found out during test
-    case 0x28:
-                                               // Part ID LPC1788 = 0x281D3F47
-                                               // Part ID LPC1787 = 0x281D3747
-                                               // Part ID LPC1786 = 0x281D1F43
-                                               // Part ID LPC1785 = 0x281D1743
-    case 0x48:                                 // Part ID LPC4088 = 0x481D3F47
-    case 0x47:                                 // Part ID LPC4078 = 0x47193F47
-                                               // Part ID LPC4076 = 0x47191F43
-                                               // Part ID LPC4074 = 0x47011132
-      CCLK  = 12000;                           // 12MHz Internal RC Oscillator
-      break;
-    default:
-      CCLK  =  4000;                           //  4MHz Internal RC Oscillator
-  }
-
-  CLKSRCSEL = 0x00;                            // sysclk = IRC
-
-  PLL0CON  = 0x00;                             // Disable PLL (use Oscillator)
-  PLL0FEED = 0xAA;                             // Feed Sequence Part #1
-  PLL0FEED = 0x55;                             // Feed Sequence Part #2
-
-  switch ((IAP.res[0] >> 24) & 0xFF) {
-    case 0x27:                                 // LPC177x
-    case 0x20:                                 // LPC178x
-    case 0x28:                                 // LPC178x
-    case 0x48:                                 // LPC407x
-    case 0x47:                                 // LPC408x
-      CCLKSEL  = 0x01;                         // use Sysclk devided by 1 for CPU
-      break;
-    default:
-      CCLKSEL  = 0x00;                         // CPU clk divider is 1
-  }
-
   MEMMAP   = 0x01;                             // User Flash Mode
-#endif
 
   return (0);
 }
 
 
 /*
@@ -283,37 +208,12 @@
  *    Return Value:   0 - OK,  1 - Failed
  */
 
 int UnInit (unsigned long fnc) {
   return (0);
 }
-
-
-/*
- *  Erase complete Flash Memory
- *    Return Value:   0 - OK,  1 - Failed
- */
-
-int EraseChip (void) {
-
-  IAP.cmd    = 50;                             // Prepare Sector for Erase
-  IAP.par[0] = 0;                              // Start Sector
-  IAP.par[1] = END_SECTOR;                     // End Sector
-  IAP_Call (&IAP.cmd, &IAP.stat);              // Call IAP Command
-  if (IAP.stat) return (1);                    // Command Failed
-
-  IAP.cmd    = 52;                             // Erase Sector
-  IAP.par[0] = 0;                              // Start Sector
-  IAP.par[1] = END_SECTOR;                     // End Sector
-  IAP.par[2] = CCLK;                           // CCLK in kHz
-  IAP_Call (&IAP.cmd, &IAP.stat);              // Call IAP Command
-  if (IAP.stat) return (1);                    // Command Failed
-
-  return (0);                                  // Finished without Errors
-}
-
 
 /*
  *  Erase Sector in Flash Memory
  *    Parameter:      adr:  Sector Address
  *    Return Value:   0 - OK,  1 - Failed
  */
2017-04-11 21:03:45 +02:00
Martin Kojtal 7d65b0f644 Merge pull request #4148 from ARMmbed/revert-4118-PR_REWORK_INTERNAL_ADC_F4
Revert "STM32F4 Internal ADC channels rework"
2017-04-11 13:39:04 +01:00
Martin Kojtal 971abf8b75 Merge pull request #4123 from neilt6/patch-3
Updated CAN to new Callback API
2017-04-11 10:18:27 +01:00
Sam Grove b2cd20c5c5 Merge pull request #4122 from neilt6/patch-1
Fixed compiler warning in mbed_retarget.cpp
2017-04-10 16:38:08 -05:00
Sam Grove e3edbabbcc Merge pull request #4107 from theotherjimmy/config-name-app
Allow configuration of artifact name in app config
2017-04-10 16:37:34 -05:00
Jimmy Brisson 55884de07e Merge pull request #4115 from cvtsi2sd/master
Support for Qt Creator Generic project export and associated Makefile
2017-04-10 16:17:14 -05:00
Sam Grove 2352ee49a4 Revert "STM32F4 Internal ADC channels rework" 2017-04-10 12:08:15 -05:00
Sam Grove 0b1117793f Merge pull request #4069 from theotherjimmy/preproc-linker-gnuarmeclipse
Update gnuarmeclipse to preprocess linker scripts
2017-04-10 11:10:58 -05:00
Sam Grove 0559aa431c Merge pull request #4126 from jeromecoutant/PR_F4_PIN_LEVEL0
STM32F4 : remove SERIAL_TX and SERIAL_RX from available pins
2017-04-10 11:09:51 -05:00
Sam Grove bfb86a7f51 Merge pull request #4125 from jeromecoutant/PR_F4_USB_CONFIG_FILE
STM32 USB configuration file move
2017-04-10 11:07:59 -05:00
Sam Grove 516f32fc86 Merge pull request #4118 from jeromecoutant/PR_REWORK_INTERNAL_ADC_F4
STM32F4 Internal ADC channels rework
2017-04-10 11:06:12 -05:00
Sam Grove cef31a7fa6 Merge pull request #4106 from theotherjimmy/fix-typo-toolchain
Fix a scoping typo in toolchains
2017-04-10 10:51:07 -05:00
Sam Grove 833a201042 Merge pull request #4102 from wdwalker/lpc-pindefs
Add SCL and SDA defs for I2C[0-2]; redefine I2C_[SCL,SDA] to I2C2
2017-04-10 10:49:50 -05:00
Sam Grove 73bee05568 Merge pull request #4100 from theotherjimmy/edit-readme
Edit the README and add Travis CI badges
2017-04-10 10:44:35 -05:00
Sam Grove 09de12161a Merge pull request #4013 from theotherjimmy/fix-subtract-basepath
Fix a small bug in subtract_basepath
2017-04-10 10:22:57 -05:00
Sam Grove 1b4a3c3204 Merge pull request #4008 from OpenNuvoton/nuvoton
[NUC472/M453] Support Bootloader and FlashIAP
2017-04-10 10:21:21 -05:00
Sam Grove c776eaa767 Merge pull request #3987 from karsev/thread_link_config_update
thread link configuration bypass flag in mesh-api
2017-04-10 10:16:05 -05:00
Anna Bridge a514216c8b Merge pull request #4098 from theotherjimmy/fail-on-bad-config
Raise error when mbed_app.json is bad
2017-04-07 12:35:49 +01:00
Matteo Italia 2baa215487 Updated year in license header 2017-04-06 23:19:52 +02:00
Jimmy Brisson aa1eefc0f1 Edit Readme and add Travis Badges 2017-04-06 11:18:59 -05:00
Sam Grove 8af190f550 Merge pull request #4112 from adamgreen/fixLpc17xxEthernetIsrAlwaysLinkedIn
Only link in LPC17xx ethernet ISR as needed
2017-04-06 11:16:10 -05:00
Sam Grove 7a35a4df51 Merge pull request #3992 from u-blox/c030-dev
Introducing UBLOX_C030 platform.
2017-04-06 11:07:58 -05:00
Sam Grove 1069dfc91a Merge pull request #3982 from mjrgh/patch-3
Ticker - kl25z bugfix for handling events in the past
2017-04-06 11:02:15 -05:00
Sam Grove 9c141b6547 Merge pull request #3911 from anangl/fix_iar_exporter
IAR exporter: extended debugger settings template with modifiable options needed for Nordic targets
2017-04-06 10:58:38 -05:00
Sam Grove f3499f5014 Merge pull request #4109 from jeromecoutant/PR_L476RG
NUCLEO_L476RG : minor serial pin update
2017-04-06 10:56:50 -05:00
Sam Grove cb4e055e19 Merge pull request #4101 from adamgreen/fixDisableDebugToSupportMoreInterfaceFirmwareRevs
Modify semihost_disabledebug() to support more interface FW revs
2017-04-06 10:54:19 -05:00
Sam Grove 14eadf389e Merge pull request #4085 from wdwalker/master
Fix mbed-cli issue #468. Add LPCTargetCode.lpc_patch to POST_BINARY_WHITELIST
2017-04-06 10:47:12 -05:00
Sam Grove caded3805e Merge pull request #4072 from seppestas/patch-3
Removed superfluous space
2017-04-06 10:40:58 -05:00
Sam Grove 2ab3eda361 Merge pull request #4070 from theotherjimmy/optionally-add-regions
Elide adding regions to profile when empty
2017-04-06 10:35:05 -05:00
Sam Grove 517982c6f7 Merge pull request #4060 from geky/fix-lpc1768-broadcast-recv
lpc1768: Remove invalid use of IP_SOF_BROADCAST_RECV option
2017-04-06 08:56:18 -05:00
Sam Grove 58f4b4103f Merge pull request #4030 from jeromecoutant/PR_IAR_SMALL_HEAP
[STM32L0] reduce IAR heap and stack size for small targets
2017-04-06 08:49:02 -05:00
Sam Grove d5058aa3fd Merge pull request #4015 from bcostm/dev_disco-l053c8_usb
DISCO_L053C8: Add support of USB Device
2017-04-06 08:47:49 -05:00
Sam Grove 6c6c2fa0ec Merge pull request #4014 from NXPmicro/Update_GCC_ARM_Linker
Issue 3763: Reduce heap allocation in the GCC linker file
2017-04-06 08:47:11 -05:00
Sam Grove fdf1ed623e Merge pull request #3994 from theotherjimmy/fix-output-ext
Use OUTPUT_EXT to pick binary type
2017-04-06 08:37:52 -05:00
jeromecoutant d740bde646 STM32F4 : remove SERIAL_TX and SERIAL_RX from available pins
Pins are used for debug printf
2017-04-06 13:58:06 +02:00
jeromecoutant 5303211056 STM32F3 USB configuration file move 2017-04-06 11:53:06 +02:00
jeromecoutant 3bbbabf202 STM32L4 USB configuration file move 2017-04-06 11:51:26 +02:00
jeromecoutant 36319969f4 STM32F7 USB configuration file move 2017-04-06 11:45:18 +02:00
jeromecoutant c2636b3269 STM32F4 USB configuration file move 2017-04-06 11:33:49 +02:00
Matteo Italia 92eae30c40 Qt Creator exporter: added derivation from GccArm Makefile
this allows Qt Creator to build the generated project "out of the box",
enabling integration with the "Issues" list
2017-04-06 11:22:21 +02:00
Matteo Italia 70412ec5a6 QtCreator exporter: switch to jinja-based templates
this also makes so that the export directory setting is honored
2017-04-06 11:22:01 +02:00
jeromecoutant d599579328 STM32F4 Internal ADC channels rework
Internal ADC pin are now out of PinMap_ADC array.
2017-04-06 10:59:49 +02:00
Neil Thiessen fd7ecda387 Updated CAN to new Callback API
Updated CAN to use new Callback assignment API in order to fix compiler warnings.
2017-04-05 21:07:55 -06:00
Neil Thiessen 6b671e5903 Fixed compiler warning in mbed_retarget.cpp
Fixed compiler warning about openmode_to_posix() being declared but never referenced.
2017-04-05 20:58:23 -06:00
Matteo Italia f3ccfbe267 Added minimal support for Qt Creator projects 2017-04-05 11:43:50 +02:00
ccli8 40a9852608 [NUC472] Fix flash algorithm
1. Remove setting of not released register ICPCON
2. Enable FMC_APUEN to update APROM
2017-04-05 11:10:48 +08:00
Adam Green be0bab3f40 Only link in LPC17xx ethernet ISR as needed
Originally the ethernet ISR would be linked in to all mbed-os based
firmware because it was named ENET_IRQHandler() so that it would be
automatically placed in the FLASH image's interrupt vector table. This
meant that programs which made no use of the lwIP stack still pulled in
this ISR.

This commit changes the name of the routine so that the ISR isn't
automatically placed in the interrupt vector table at link time but is
instead dynamically placed in the interrupt vector table at runtime
when the lwIP stack is initialized. Now the ethernet ISR is only linked
in when it is actually needed.

Example arm-none-eabi-size output for a simple LED blinking program
showing the before and after size results:
   text	   data	    bss	    dec	    hex	filename
  13208	    148	   7784	  21140	   5294	LPC1768/HelloWorld.elf

   text	   data	    bss	    dec	    hex	filename
  12700	    148	   7468	  20316	   4f5c	LPC1768/HelloWorld.elf
2017-04-04 14:42:21 -07:00
Jimmy Brisson 6a646eb4b2 Allow configuration of artifact name in app config 2017-04-04 14:36:01 -05:00
Rob Meades 7387c09872 Introducing UBLOX_C030 platform. 2017-04-04 16:22:50 +01:00
jeromecoutant 0c2720bc19 NUCLEO_L476RG : minor serial pin update
SERIAL_TX and SERIAL_RX pins used for debug printf cannot be set as available
2017-04-04 14:38:17 +02:00