[En-Nut-Discussion] En-Nut-Discussion Digest, Vol 106, Issue 11

William Basser wbasser at gmail.com
Sat Aug 18 16:58:30 CEST 2012


For byte manipulation you could uses a union as follows:
typedef union
{
    u8_t      value_u8[4];
    u16_t   value_u16[2];
    u32_t   value_u32;
} U32UN;

#define  LE_U32_LSB_IDX    0
#define  LE_U32_MS1_IDX   1
#define

On Sat, Aug 18, 2012 at 5:00 AM, <en-nut-discussion-request at egnite.de>wrote:

> Send En-Nut-Discussion mailing list submissions to
>         en-nut-discussion at egnite.de
>
> To subscribe or unsubscribe via the World Wide Web, visit
>         http://lists.egnite.de/mailman/listinfo/en-nut-discussion
> or, via email, send a message with subject or body 'help' to
>         en-nut-discussion-request at egnite.de
>
> You can reach the person managing the list at
>         en-nut-discussion-owner at egnite.de
>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of En-Nut-Discussion digest..."
>
>
> Today's Topics:
>
>    1. LPC17xx fails to compile (Harald Kipp)
>    2. owibus sample fails to build (Harald Kipp)
>    3. stm32_can.c fails to build (Harald Kipp)
>    4. stm32_can1.c fails to build (Harald Kipp)
>    5. GCC for Cortex-M4 available on Windows? (Harald Kipp)
>    6. Re: GCC for Cortex-M4 available on Windows? (Ole Reinhardt)
>    7. Re: owibus sample fails to build (Uwe Bonnes)
>    8. Re: stm32_can.c fails to build (Uwe Bonnes)
>
>
> ----------------------------------------------------------------------
>
> Message: 1
> Date: Fri, 17 Aug 2012 14:56:17 +0200
> From: Harald Kipp <harald.kipp at egnite.de>
> Subject: [En-Nut-Discussion] LPC17xx fails to compile
> To: "Ethernut User Chat (English)" <en-nut-discussion at egnite.de>
> Message-ID: <502E3F71.5070704 at egnite.de>
> Content-Type: text/plain; charset=ISO-8859-15
>
> Using the trunk, I get the following error:
>
> Target : flecx10a-cm3-gcc-bld
> Command: SET
> PATH=e:\ethernut\nut-trunk\nut\tools\win32;%ProgramFiles(x86)%\yagarto\bin;e:\apps\bin;%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;&make
> clean all install
> Error  : 2
> ------------------------------------------------------------------------
> "  [CC] ../.././nut/arch/cm3/dev/nxp/lpc176x_clk.c"
> "  [CC] ../.././nut/arch/cm3/dev/nxp/lpc176x_gpio.c"
> "  [CC] ../.././nut/arch/cm3/dev/nxp/lpc17xx_gpioirq.c"
> "  [CC] ../.././nut/arch/cm3/dev/nxp/ih_lpc17xx_pio.c"
> ../.././nut/arch/cm3/dev/nxp/ih_lpc17xx_pio.c: In function 'GpioIrqCtl':
> ../.././nut/arch/cm3/dev/nxp/ih_lpc17xx_pio.c:99:32: error: 'GPIO_IRQn'
> undeclared (first use in this function)
> ../.././nut/arch/cm3/dev/nxp/ih_lpc17xx_pio.c:99:32: note: each undeclared
> identifier is reported only once for each function it appears in
> make[1]: *** [cm3/dev/nxp/ih_lpc17xx_pio.o] Error 1
> make[1]: Leaving directory
> `E:/ethernut/ethernut-5.0.5/flecx10a-cm3-gcc-bld/arch'
> make: *** [all] Error 2
>
>
>
> ------------------------------
>
> Message: 2
> Date: Fri, 17 Aug 2012 15:35:25 +0200
> From: Harald Kipp <harald.kipp at egnite.de>
> Subject: [En-Nut-Discussion] owibus sample fails to build
> To: "Ethernut User Chat (English)" <en-nut-discussion at egnite.de>
> Message-ID: <502E489D.7080507 at egnite.de>
> Content-Type: text/plain; charset=ISO-8859-15
>
> When trying to build app/owibus for the FLECX board (LPC1768), I got the
> following error:
>
> make -C owibus
> make[1]: Entering directory
> `E:/ethernut/ethernut-5.0.5/flecx10a-cm3-gcc-app/owibus'
> "  [CC] owibus.c"
> owibus.c: In function 'main':
> owibus.c:48:4: warning: #warning "Please defined the UART to use for the
> One-Wire Bus for your board" [-Wcpp]
> owibus.c:56:39: error: 'devUsartStm32_1' undeclared (first use in this
> function)
> owibus.c:56:39: note: each undeclared identifier is reported only once for
> each function it appears in
> make[1]: *** [owibus.o] Error 1
> make[1]: Leaving directory
> `E:/ethernut/ethernut-5.0.5/flecx10a-cm3-gcc-app/owibus'
> make: *** [all] Error 2
>
> To be able to move on, I temporarily moved the sample to hwtest.
>
> Please note, that all samples shall compile on all platforms. If any
> hardware requirement is missing, the sample should report this at runtime,
> not compile time.
>
> Regards,
>
> Harald
>
>
>
>
> ------------------------------
>
> Message: 3
> Date: Fri, 17 Aug 2012 15:38:22 +0200
> From: Harald Kipp <harald.kipp at egnite.de>
> Subject: [En-Nut-Discussion] stm32_can.c fails to build
> To: "Ethernut User Chat (English)" <en-nut-discussion at egnite.de>
> Message-ID: <502E494E.7040706 at egnite.de>
> Content-Type: text/plain; charset=ISO-8859-15
>
> I got the following problem when trying to build Nut/OS for STM32:
>
> ------------------------------------------------------------------------
> Target : stm32_can-cm3-gcc-bld
> Command: SET
> PATH=e:\ethernut\nut-trunk\nut\tools\win32;%ProgramFiles(x86)%\yagarto\bin;e:\apps\bin;%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;&make
> clean all install
> Error  : 2
> ------------------------------------------------------------------------
> "  [CC] ../.././nut/arch/cm3/dev/stm/stm32_can.c"
> ../.././nut/arch/cm3/dev/stm/stm32_can.c: In function 'StmCanSendMsg':
> ../.././nut/arch/cm3/dev/stm/stm32_can.c:867:5: error: dereferencing
> type-punned pointer will break strict-aliasing rules
> [-Werror=strict-aliasing]
> ../.././nut/arch/cm3/dev/stm/stm32_can.c: In function 'CanInput':
> ../.././nut/arch/cm3/dev/stm/stm32_can.c:941:5: error: dereferencing
> type-punned pointer will break strict-aliasing rules
> [-Werror=strict-aliasing]
> cc1.exe: all warnings being treated as errors
>
> make[1]: *** [cm3/dev/stm/stm32_can.o] Error 1
> make[1]: Leaving directory
> `E:/ethernut/ethernut-5.0.5/stm32_can-cm3-gcc-bld/arch'
> make: *** [all] Error 2
>
>
>
> ------------------------------
>
> Message: 4
> Date: Fri, 17 Aug 2012 15:40:49 +0200
> From: Harald Kipp <harald.kipp at egnite.de>
> Subject: [En-Nut-Discussion] stm32_can1.c fails to build
> To: "Ethernut User Chat (English)" <en-nut-discussion at egnite.de>
> Message-ID: <502E49E1.8010908 at egnite.de>
> Content-Type: text/plain; charset=ISO-8859-15
>
> I got the following problem when trying to build Nut/OS for STM3210C
> Evalboard:
>
> ------------------------------------------------------------------------
> Target : stm3210c-eval-cm3-gcc-bld
> Command: SET
> PATH=e:\ethernut\nut-trunk\nut\tools\win32;%ProgramFiles(x86)%\yagarto\bin;e:\apps\bin;%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;&make
> clean all install
> Error  : 2
> ------------------------------------------------------------------------
> ../.././nut/arch/cm3/dev/stm/stm32_can1.c:91:4: error: #error "Illegal
> CANBUS1_REMAP_CAN value"
> ../.././nut/arch/cm3/dev/stm/stm32_can1.c: In function 'Stm32CanHw1Init':
> ../.././nut/arch/cm3/dev/stm/stm32_can1.c:173:22: error:
> 'CAN1RX_GPIO_PORT' undeclared (first use in this function)
> ../.././nut/arch/cm3/dev/stm/stm32_can1.c:173:22: note: each undeclared
> identifier is reported only once for each function it appears in
> ../.././nut/arch/cm3/dev/stm/stm32_can1.c:173:40: error: 'CAN1RX_GPIO_PIN'
> undeclared (first use in this function)
> ../.././nut/arch/cm3/dev/stm/stm32_can1.c:174:22: error:
> 'CAN1TX_GPIO_PORT' undeclared (first use in this function)
> ../.././nut/arch/cm3/dev/stm/stm32_can1.c:174:40: error: 'CAN1TX_GPIO_PIN'
> undeclared (first use in this function)
> make[1]: *** [cm3/dev/stm/stm32_can1.o] Error 1
> make[1]: Leaving directory
> `E:/ethernut/ethernut-5.0.5/stm3210c-eval-cm3-gcc-bld/arch'
> make: *** [all] Error 2
>
>
> ------------------------------
>
> Message: 5
> Date: Fri, 17 Aug 2012 15:45:56 +0200
> From: Harald Kipp <harald.kipp at egnite.de>
> Subject: [En-Nut-Discussion] GCC for Cortex-M4 available on Windows?
> To: "Ethernut User Chat (English)" <en-nut-discussion at egnite.de>
> Message-ID: <502E4B14.4080708 at egnite.de>
> Content-Type: text/plain; charset=ISO-8859-15
>
> Trying to build the Nut/OS libraries for usps_f405g results in
>
> ------------------------------------------------------------------------
> Target : usps_f405g-cm3-gcc-bld
> Command: SET
> PATH=e:\ethernut\nut-trunk\nut\tools\win32;%ProgramFiles(x86)%\yagarto\bin;e:\apps\bin;%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;&make
> clean all install
> Error  : 2
> ------------------------------------------------------------------------
> make[1]: Leaving directory
> `E:/ethernut/ethernut-5.0.5/usps_f405g-cm3-gcc-bld/contrib'
> make -C arch
> make[1]: Entering directory
> `E:/ethernut/ethernut-5.0.5/usps_f405g-cm3-gcc-bld/arch'
> "  [CC] ../.././nut/arch/cm3/cmsis/core_cm3.c"
> Assembler messages:
> Error: unknown cpu `cortex-m4'
> Error: unrecognized option -mcpu=cortex-m4
> make[1]: *** [cm3/cmsis/core_cm3.o] Error 1
> make[1]: Leaving directory
> `E:/ethernut/ethernut-5.0.5/usps_f405g-cm3-gcc-bld/arch'
> make: *** [all] Error 2
>
> Looks like I have to upgrade the compiler. I'm currently using the latest
> YAGARTO (GCC 4.6.0). Any later binary available on Windows or do I have to
> switch to Linux?
>
> Regards,
>
> Harald
>
>
>
> ------------------------------
>
> Message: 6
> Date: Fri, 17 Aug 2012 18:06:28 +0200
> From: Ole Reinhardt <ole.reinhardt at embedded-it.de>
> Subject: Re: [En-Nut-Discussion] GCC for Cortex-M4 available on
>         Windows?
> To: Harald Kipp <harald.kipp at egnite.de>
> Cc: "Ethernut User Chat \(English\)" <en-nut-discussion at egnite.de>
> Message-ID: <1345219588.2503.90.camel at platon>
> Content-Type: text/plain; charset="ISO-8859-15"
>
> Hi Harald,
>
> > Looks like I have to upgrade the compiler. I'm currently using the
> > latest YAGARTO (GCC 4.6.0). Any later binary available on Windows or do
> > I have to switch to Linux?
>
> The following yagarto should work. With the latest one I also
> experienced internal compiler errors :(
>
> http://sourceforge.net/projects/yagarto/files/YAGARTO%20for%
> 20Windows/20111119/
>
> Bye,
>
> Ole
>
> --
>
> Thermotemp GmbH, Embedded-IT
>
> Embedded Hard-/ Software and Open Source Development,
> Integration and Consulting
>
> http://www.embedded-it.de
>
> Gesch?ftsstelle Siegen - Steinstra?e 67 - D-57072 Siegen -
> tel +49 (0)271 5513597, +49 (0)271-73681 - fax +49 (0)271 736 97
>
> Hauptsitz - Hademarscher Weg 7 - 13503 Berlin
> Tel +49 (0)30 4315205 - Fax +49 (0)30 43665002
> Gesch?ftsf?hrer: J?rg Friedrichs, Ole Reinhardt
> Handelsregister Berlin Charlottenburg HRB 45978 UstID DE 156329280
>
>
>
> ------------------------------
>
> Message: 7
> Date: Fri, 17 Aug 2012 22:28:00 +0200
> From: Uwe Bonnes <bon at elektron.ikp.physik.tu-darmstadt.de>
> Subject: Re: [En-Nut-Discussion] owibus sample fails to build
> To: "Ethernut User Chat \(English\)" <en-nut-discussion at egnite.de>
> Message-ID:
>         <20526.43344.258562.652308 at elektron.ikp.physik.tu-darmstadt.de>
> Content-Type: text/plain; charset=us-ascii
>
> >>>>> "Harald" == Harald Kipp <harald.kipp at egnite.de> writes:
>
>     Harald> When trying to build app/owibus for the FLECX board (LPC1768),
> I
>     Harald> got the following error: make -C owibus make[1]: Entering
>     Harald> directory
>     Harald> `E:/ethernut/ethernut-5.0.5/flecx10a-cm3-gcc-app/owibus' " [CC]
>     Harald> owibus.c" owibus.c: In function 'main': owibus.c:48:4: warning:
>     Harald> #warning "Please defined the UART to use for the One-Wire Bus
>     Harald> for your board" [-Wcpp] owibus.c:56:39: error:
> 'devUsartStm32_1'
>     Harald> undeclared (first use in this function) owibus.c:56:39: note:
>     Harald> each undeclared identifier is reported only once for each
>     Harald> function it appears in make[1]: *** [owibus.o] Error 1 make[1]:
>     Harald> Leaving directory
>     Harald> `E:/ethernut/ethernut-5.0.5/flecx10a-cm3-gcc-app/owibus' make:
>     Harald> *** [all] Error 2
>
> When writing I thought that the warning was adequate. However as a missing
> definition aborts compile, I see it is not adequate...
>
>     Harald> To be able to move on, I temporarily moved the sample to
> hwtest.
>
>     Harald> Please note, that all samples shall compile on all platforms.
> If
>     Harald> any hardware requirement is missing, the sample should report
>     Harald> this at runtime, not compile time.
>
> How should we handle that case? There is no intrinsic connection of either
> some of the UARTs or a port pin to the OWI device. The board either has
> such
> a connection or not. So to use some default UART or port pin to let the
> example compile seems inadequate. But if the owibus example is not in the
> app directory, chances are much lower that people detect the example. Any
> ideas?
>
> B.t.w. thanks for the style/licence/etc corrections. I will try to learn
> for
> future contribytions.
>
> Bye
> --
> Uwe Bonnes                bon at elektron.ikp.physik.tu-darmstadt.de
>
> Institut fuer Kernphysik  Schlossgartenstrasse 9  64289 Darmstadt
> --------- Tel. 06151 162516 -------- Fax. 06151 164321 ----------
>
>
> ------------------------------
>
> Message: 8
> Date: Fri, 17 Aug 2012 22:31:27 +0200
> From: Uwe Bonnes <bon at elektron.ikp.physik.tu-darmstadt.de>
> Subject: Re: [En-Nut-Discussion] stm32_can.c fails to build
> To: "Ethernut User Chat \(English\)" <en-nut-discussion at egnite.de>
> Message-ID:
>         <20526.43551.429066.693818 at elektron.ikp.physik.tu-darmstadt.de>
> Content-Type: text/plain; charset=us-ascii
>
> >>>>> "Harald" == Harald Kipp <harald.kipp at egnite.de> writes:
>
>     Harald> I got the following problem when trying to build Nut/OS for
>     Harald> STM32:
>     Harald>
> ------------------------------------------------------------------------
>     Harald> Target : stm32_can-cm3-gcc-bld Command: SET
>     Harald>
> PATH=e:\ethernut\nut-trunk\nut\tools\win32;%ProgramFiles(x86)%\yagarto\bin;e:\apps\bin;%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;&make
>     Harald> clean all install Error : 2
>     Harald>
> ------------------------------------------------------------------------
>     Harald> " [CC] ../.././nut/arch/cm3/dev/stm/stm32_can.c"
>     Harald> ../.././nut/arch/cm3/dev/stm/stm32_can.c: In function
>     Harald> 'StmCanSendMsg':
> ../.././nut/arch/cm3/dev/stm/stm32_can.c:867:5:
>     Harald> error: dereferencing type-punned pointer will break
>     Harald> strict-aliasing rules [-Werror=strict-aliasing]
>     Harald> ../.././nut/arch/cm3/dev/stm/stm32_can.c: In function
>     Harald> 'CanInput': ../.././nut/arch/cm3/dev/stm/stm32_can.c:941:5:
>     Harald> error: dereferencing type-punned pointer will break
>     Harald> strict-aliasing rules [-Werror=strict-aliasing] cc1.exe: all
>     Harald> warnings being treated as errors
>
> The trouble case is, where 4 consequitive bytes of the can frame data
> payload get mapped to a 32-bit register. The cast worked for me and my gcc
> ;-)
>
> Should I write as
>  reg32 = byte[0] | (byte[1] <<8)| (bute[2]<<16) | (byte[3] <<24)
>
> or is there a better construct?
>
> Thanks
>
> --
> Uwe Bonnes                bon at elektron.ikp.physik.tu-darmstadt.de
>
> Institut fuer Kernphysik  Schlossgartenstrasse 9  64289 Darmstadt
> --------- Tel. 06151 162516 -------- Fax. 06151 164321 ----------
>
>
> ------------------------------
>
> _______________________________________________
> http://lists.egnite.de/mailman/listinfo/en-nut-discussion
>
>
> End of En-Nut-Discussion Digest, Vol 106, Issue 11
> **************************************************
>


More information about the En-Nut-Discussion mailing list