Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Misc fixes for LPC4088/LPC4088DM: #1811

Merged
merged 2 commits into from
Jun 3, 2016
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,9 @@ typedef struct
__IO uint32_t EXTPOLAR; /*!< Offset: 0x14C (R/W) External Interrupt Polarity Register */
uint32_t RESERVED6[12];
__IO uint32_t RSID; /*!< Offset: 0x180 (R/W) Reset Source Identification Register */
uint32_t RESERVED7[7];
uint32_t RESERVED7[1];
__IO uint32_t MATRIXARB; /*!< Offset: 0x188 (R/W) Matrix Arbitration Register */
uint32_t RESERVED71[5];
__IO uint32_t SCS; /*!< Offset: 0x1A0 (R/W) System Controls and Status Register */
__IO uint32_t IRCTRIM; /*!< Offset: 0x1A4 (R/W) Clock Dividers */
__IO uint32_t PCLKSEL; /*!< Offset: 0x1A8 (R/W) Peripheral Clock Selection Register */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -567,5 +567,15 @@ fpu_init();
SCB->VTOR = 0x00000000 & 0x3FFFFF80;
#endif
#endif

/* Must set ROM_LAT bit in the Matrix Arbitration Register otherwise SPIFI
* initialization will cause debugging to HardFault */
LPC_SC->MATRIXARB |= (1<<16);

/* Reset LCD Controller to prevent strange behavior when doing a partial
* reset (happens when debugging).
*/
LPC_SC->RSTCON0 = 1;

SystemCoreClockUpdate();
}
6 changes: 6 additions & 0 deletions libraries/net/eth/lwip-eth/arch/TARGET_NXP/lwipopts_conf.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,10 @@
#define MEM_SIZE 16362
#endif

#if defined (TOOLCHAIN_GCC_CR)
/* For LPCXpresso IDE above v8.0.0 to avoid clash with timeval struct */
#include <sys/time.h>
#define LWIP_TIMEVAL_PRIVATE 0
#endif

#endif
4 changes: 2 additions & 2 deletions workspace_tools/export/codered_lpc4088_cproject.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@
<tool id="com.crt.advproject.gas.exe.debug.1277199919" name="MCU Assembler" superClass="com.crt.advproject.gas.exe.debug">
<option id="com.crt.advproject.gas.arch.1079400011" name="Architecture" superClass="com.crt.advproject.gas.arch" value="com.crt.advproject.gas.target.cm4" valueType="enumerated"/>
<option id="com.crt.advproject.gas.thumb.1976113150" name="Thumb mode" superClass="com.crt.advproject.gas.thumb" value="true" valueType="boolean"/>
<option id="gnu.both.asm.option.flags.crt.1501250871" name="Assembler flags" superClass="gnu.both.asm.option.flags.crt" value="-c -x assembler-with-cpp -D__NEWLIB__ -DDEBUG -D__CODE_RED " valueType="string"/>
<option id="gnu.both.asm.option.flags.crt.1501250871" name="Assembler flags" superClass="gnu.both.asm.option.flags.crt" value="-c -x assembler-with-cpp -D__NEWLIB__ -DDEBUG -D__CODE_RED -DFPU_PRESENT=1 " valueType="string"/>
<option id="com.crt.advproject.gas.hdrlib.473313643" name="Use headers for C library" superClass="com.crt.advproject.gas.hdrlib" value="com.crt.advproject.gas.hdrlib.newlib" valueType="enumerated"/>
<option id="com.crt.advproject.gas.fpu.478766821" name="Floating point" superClass="com.crt.advproject.gas.fpu" value="com.crt.advproject.gas.fpu.fpv4" valueType="enumerated"/>
<inputType id="com.crt.advproject.assembler.input.910682278" name="Additional Assembly Source Files" superClass="com.crt.advproject.assembler.input"/>
Expand Down Expand Up @@ -981,7 +981,7 @@
<tool id="com.crt.advproject.gas.exe.release.579950187" name="MCU Assembler" superClass="com.crt.advproject.gas.exe.release">
<option id="com.crt.advproject.gas.arch.1401271875" name="Architecture" superClass="com.crt.advproject.gas.arch" value="com.crt.advproject.gas.target.cm3" valueType="enumerated"/>
<option id="com.crt.advproject.gas.thumb.1024544278" name="Thumb mode" superClass="com.crt.advproject.gas.thumb" value="true" valueType="boolean"/>
<option id="gnu.both.asm.option.flags.crt.637466836" name="Assembler flags" superClass="gnu.both.asm.option.flags.crt" value="-c -x assembler-with-cpp -D__NEWLIB__ -DNDEBUG -D__CODE_RED " valueType="string"/>
<option id="gnu.both.asm.option.flags.crt.637466836" name="Assembler flags" superClass="gnu.both.asm.option.flags.crt" value="-c -x assembler-with-cpp -D__NEWLIB__ -DNDEBUG -D__CODE_RED -DFPU_PRESENT=1 " valueType="string"/>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why is this macro not in the target (generic for all exporters) ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I honestly don't know. From what I can see in the template the flags/symbols that are set are never passed to the assembler, they are only passed to the C and C++ compilers. It also seems like the flags/symbols are passed to the assembler differently compared to the C/C++ compilers so using the {% for s in symbols %} is not an option?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it is. You can add those symbols here. I recall I saw this FPU_PRESENT for cpu with fpus. Here: https://github.com/mbedmicro/mbed/blob/master/workspace_tools/toolchains/__init__.py#L168

If you add macros here as you proposd, that should fix it.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the list you link to there is already a FPU_PRESENT for the Cortex-M4F and not for the Cortex-M4 which is logical. However the project files generated for the LPC4088 for LPCXpresso by the online compiler will have the FPU_PRESENT set for C code and C++ code but not for assembler. To me that indicates that either the project generation routine is wrong or the LPC4088 targets are configured as being both M4 and M4F.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You pinponted it previously, that for asm , macros are not added. this line does it for c: https://github.com/lindvalla/mbed/blob/d8935bb837267b1c95cee7fbb5ddadc54be5b753/workspace_tools/export/codered_lpc4088_cproject.tmpl#L33

same should be applied to asm I would say. For uvision , this is the case and FPU_PRESENT should be defined when exporting.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will test it tomorrow at work. However I'm not sure that it will work. The LPCXpresso IDE has completely different ways of specifying flags/symbols for asm (i.e. the GUI has lists of symbols for c/c++ but for assembler it is only one input field). I'll post my findings when I have tested it.

<option id="com.crt.advproject.gas.hdrlib.492600365" name="Use headers for C library" superClass="com.crt.advproject.gas.hdrlib" value="com.crt.advproject.gas.hdrlib.newlib" valueType="enumerated"/>
<inputType id="com.crt.advproject.assembler.input.812068162" name="Additional Assembly Source Files" superClass="com.crt.advproject.assembler.input"/>
</tool>
Expand Down
4 changes: 2 additions & 2 deletions workspace_tools/export/codered_lpc4088_dm_cproject.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@
<tool id="com.crt.advproject.gas.exe.debug.1277199919" name="MCU Assembler" superClass="com.crt.advproject.gas.exe.debug">
<option id="com.crt.advproject.gas.arch.1079400011" name="Architecture" superClass="com.crt.advproject.gas.arch" value="com.crt.advproject.gas.target.cm4" valueType="enumerated"/>
<option id="com.crt.advproject.gas.thumb.1976113150" name="Thumb mode" superClass="com.crt.advproject.gas.thumb" value="true" valueType="boolean"/>
<option id="gnu.both.asm.option.flags.crt.1501250871" name="Assembler flags" superClass="gnu.both.asm.option.flags.crt" value="-c -x assembler-with-cpp -D__NEWLIB__ -DDEBUG -D__CODE_RED " valueType="string"/>
<option id="gnu.both.asm.option.flags.crt.1501250871" name="Assembler flags" superClass="gnu.both.asm.option.flags.crt" value="-c -x assembler-with-cpp -D__NEWLIB__ -DDEBUG -D__CODE_RED -DFPU_PRESENT=1 " valueType="string"/>
<option id="com.crt.advproject.gas.hdrlib.473313643" name="Use headers for C library" superClass="com.crt.advproject.gas.hdrlib" value="com.crt.advproject.gas.hdrlib.newlib" valueType="enumerated"/>
<option id="com.crt.advproject.gas.fpu.478766821" name="Floating point" superClass="com.crt.advproject.gas.fpu" value="com.crt.advproject.gas.fpu.fpv4" valueType="enumerated"/>
<inputType id="com.crt.advproject.assembler.input.910682278" name="Additional Assembly Source Files" superClass="com.crt.advproject.assembler.input"/>
Expand Down Expand Up @@ -981,7 +981,7 @@
<tool id="com.crt.advproject.gas.exe.release.579950187" name="MCU Assembler" superClass="com.crt.advproject.gas.exe.release">
<option id="com.crt.advproject.gas.arch.1401271875" name="Architecture" superClass="com.crt.advproject.gas.arch" value="com.crt.advproject.gas.target.cm3" valueType="enumerated"/>
<option id="com.crt.advproject.gas.thumb.1024544278" name="Thumb mode" superClass="com.crt.advproject.gas.thumb" value="true" valueType="boolean"/>
<option id="gnu.both.asm.option.flags.crt.637466836" name="Assembler flags" superClass="gnu.both.asm.option.flags.crt" value="-c -x assembler-with-cpp -D__NEWLIB__ -DNDEBUG -D__CODE_RED " valueType="string"/>
<option id="gnu.both.asm.option.flags.crt.637466836" name="Assembler flags" superClass="gnu.both.asm.option.flags.crt" value="-c -x assembler-with-cpp -D__NEWLIB__ -DNDEBUG -D__CODE_RED -DFPU_PRESENT=1 " valueType="string"/>
<option id="com.crt.advproject.gas.hdrlib.492600365" name="Use headers for C library" superClass="com.crt.advproject.gas.hdrlib" value="com.crt.advproject.gas.hdrlib.newlib" valueType="enumerated"/>
<inputType id="com.crt.advproject.assembler.input.812068162" name="Additional Assembly Source Files" superClass="com.crt.advproject.assembler.input"/>
</tool>
Expand Down