Teil 2: SRC-Download und Listing im Heft unterschiedlich

ARM fuer Einsteiger

Re: Teil 2: SRC-Download und Listing im Heft unterschiedlich

Postby ag » Fri Feb 27, 2015 8:26 am

Hallo Gerhard,

@ag: Ich verstehe nur nicht, warum bei "ag" das fehlerhafte main.c von der Elektorseite gegangen ist.


Mit "fehlerhafte main.c" vermute ich dass du die fehlende declaration eines Prototyps für Funktion configure_port_pins meinst. Ich glaube dass der compiler in der lage ist, ein Prototyp selbständig abzuleiten aus dem Funktionsparameter, und dass, aus Gründe der Rückwärtskompatabilität, in c ein Prototyp deshalb nicht immer zwingend erforderlich ist. Du kannst das verifizieren, indem du einfach die entsprechende Zeile auskommentierst und nochmal versuchts zu komilieren.

Viele Grüße,
Ag
ag
 
Posts: 532
Joined: Thu Jan 02, 2014 10:37 am

Re: Teil 2: SRC-Download und Listing im Heft unterschiedlich

Postby ge1ge » Fri Feb 27, 2015 11:12 am

Hallo ag,

beide Versionen, die von der Elektor-page (main.c from 22.12.2014 11:03), als auch die, die ich in diesem Thread als "code" reinkopiert habe (main.c from 29.12.2014 06:36), erzeugten einen Kompiler-Error":
implicit declaration of function 'strcmp' [-Werror=implicit-function-declaration]
der auf diesen Befehl zeigte:
Code: Select all
if (strcmp((uint8_t *)string1, (uint8_t *)string2) == 0) //If UART received "greenLED 1", put the green LED on


Problem war anscheinend, dass
#include <string.h>
fehlte, das dann in der main.c vom 26.02.2015 16:22 ergänzt wurde.-

Schöne Grüße
Gerhard
ge1ge
 
Posts: 11
Joined: Fri Jan 30, 2015 8:54 pm

Re: Teil 2: SRC-Download und Listing im Heft unterschiedlich

Postby ag » Fri Feb 27, 2015 12:28 pm

Hallo Gerhard,

ich habe das main.c von 22.12.2014 11:03:06 verwendet. Dort gibt es keine #include <string.h>, keine Prototyp deklariert, und keine Fehler beim kompilieren (nur Warnungen, z.B. wegen fehlende Prototyp - siehe unten). Wenn diese Datei auch bei dir echte Fehler erzeugt, denke ich dass es an irgend welche Einstellungen (z.B. am Compiler) in Atmel Studio liegen muss.

Code: Select all
#include <asf.h>

#define LEDG  PIN_PB00                                     //define the pins
#define SW1   PIN_PB06
#define SW2   PIN_PB07


void configure_port_pins(void)                             //setup of the configuration of the pins
{
   struct port_config config_port_pin;
   port_get_config_defaults(&config_port_pin);
   
   config_port_pin.direction = PORT_PIN_DIR_OUTPUT;
   port_pin_set_config(LEDG, &config_port_pin);       //PB00 (green LED) as output
   port_group_set_config(&PORTB, 6, &config_port_pin);    //PB01 (yellow LED) and PB02 (red LEDS) as output
   
   config_port_pin.direction = PORT_PIN_DIR_INPUT;
   config_port_pin.input_pull = PORT_PIN_PULL_DOWN;
   port_pin_set_config(SW1, &config_port_pin);       //PB07 (SW1) as input with pull down
   
   config_port_pin.input_pull = PORT_PIN_PULL_UP;
   port_pin_set_config(SW2, &config_port_pin);       //PB06 (SW2) as input with pull-up
   
   
}


struct usart_module usart_instance;                   //generate a variable of the usart_module struct

void configure_usart(void)                            //setup of the configuration of UART
{
   struct usart_config config_usart;
   usart_get_config_defaults(&config_usart);
   
   config_usart.baudrate = 9600;                             //set baudrate
   config_usart.mux_setting = EDBG_CDC_SERCOM_MUX_SETTING;   //set the pins
   config_usart.pinmux_pad0 = EDBG_CDC_SERCOM_PINMUX_PAD0;
   config_usart.pinmux_pad1 = EDBG_CDC_SERCOM_PINMUX_PAD1;
   config_usart.pinmux_pad2 = EDBG_CDC_SERCOM_PINMUX_PAD2;
   config_usart.pinmux_pad3 = EDBG_CDC_SERCOM_PINMUX_PAD3;
   
   while (usart_init(&usart_instance, EDBG_CDC_MODULE, &config_usart) != STATUS_OK){} //configure the SERCOM as USART
   usart_enable(&usart_instance);       
}

int main (void)
{
   system_init();                                            //initialization
   configure_usart();                                        //configuration
   configure_port_pins();                                   
   uint8_t string1[] = "          ";                         // initialize six strings
   uint8_t string2[] = "greenLED 1";
   uint8_t string3[] = "greenLED 0";
   uint8_t string4[] = "SW1 status";
   uint8_t string5[] = "OK";
   uint8_t string6[] = "\n";
   
   while (1) {
   if (usart_read_buffer_wait(&usart_instance, &string1, 10) == STATUS_OK)   //if the UART received 10 bytes
   {
      if (strcmp(string1, string2) == 0)                     //If UART received "greenLED 1", put the green LED on
      {
         port_pin_set_output_level(LEDG, 1);
         while(usart_write_buffer_wait(&usart_instance, &string5, 2) != STATUS_OK){} //and send OK
      }
      if (strcmp(string1, string3) == 0)                     //If UART received "greenLED 0", put the green LED off
      {
         port_pin_set_output_level(LEDG, 0);
         while(usart_write_buffer_wait(&usart_instance, &string5, 2) != STATUS_OK){} //and send OK
      }
      if (strcmp(string1, string4) == 0)                     //If UART received "SW1 status", send the status of SW1
      {
         if (port_pin_get_input_level(SW1) == 1)
         {
            usart_write_wait(&usart_instance, 49);         //write 1
         }
         else{
            usart_write_wait(&usart_instance, 48);         //write 0
         }
      
      }
   while(usart_write_buffer_wait(&usart_instance, &string6, 2) != STATUS_OK){}   //new line
   }
   }
}


    C:\Users\Donnie\Downloads\140512-11\The first project with UART\The first project with UART\src\main.c(71,3): warning: pointer targets in passing argument 2 of 'strcmp' differ in signedness [-Wpointer-sign]
    if (strcmp(string1, string4) == 0) //If UART received "SW1 status", send the status of SW1
    ^
    In file included from d:\program files (x86)\atmel\atmel toolchain\arm gcc\native\4.8.1443\arm-gnu-toolchain\arm-none-eabi\include\stdio.h:29:0,
    from ../src/ASF/sam0/utils/compiler.h:66,
    from ../src/asf.h:56,
    from ../src/main.c:1:
    d:\program files (x86)\atmel\atmel toolchain\arm gcc\native\4.8.1443\arm-gnu-toolchain\arm-none-eabi\include\string.h(28,6): info: expected 'const char *' but argument is of type 'uint8_t *'
    int _EXFUN(strcmp,(const char *, const char *));
    ^
    C:\Users\Donnie\Downloads\140512-11\The first project with UART\The first project with UART\src\main.c(82,2): warning: passing argument 2 of 'usart_write_buffer_wait' from incompatible pointer type [enabled by default]
    while(usart_write_buffer_wait(&usart_instance, &string6, 2) != STATUS_OK){} //new line
    ^
    In file included from ../src/asf.h:75:0,
    from ../src/main.c:1:
    C:\Users\Donnie\Downloads\140512-11\The first project with UART\The first project with UART\src\ASF\sam0\drivers\sercom\usart\usart.h(935,18): info: expected 'const uint8_t *' but argument is of type 'uint8_t (*)[2]'
    enum status_code usart_write_buffer_wait(
    ^
    Finished building: ../src/main.c
    Building target: The first project with UART.elf
    Invoking: ARM/GNU Linker : 4.8.4
    "D:\Program Files (x86)\Atmel\Atmel Toolchain\ARM GCC\Native\4.8.1443\arm-gnu-toolchain\bin\arm-none-eabi-gcc.exe" -o "The first project with UART.elf" src/ASF/sam0/drivers/sercom/sercom.o src/ASF/sam0/drivers/sercom/usart/usart.o src/ASF/common/utils/interrupt/interrupt_sam_nvic.o src/ASF/sam0/boards/samd20_xplained_pro/board_init.o src/ASF/sam0/drivers/port/port.o src/ASF/sam0/drivers/system/clock/clock_samd20/clock.o src/ASF/sam0/drivers/system/clock/clock_samd20/gclk.o src/ASF/sam0/drivers/system/interrupt/system_interrupt.o src/ASF/sam0/drivers/system/pinmux/pinmux.o src/ASF/sam0/drivers/system/system.o src/ASF/sam0/utils/cmsis/samd20/source/gcc/startup_samd20.o src/ASF/sam0/utils/cmsis/samd20/source/system_samd20.o src/ASF/sam0/utils/syscalls/gcc/syscalls.o src/main.o -mthumb -Wl,-Map="The first project with UART.map" --specs=nano.specs -Wl,--start-group -larm_cortexM0l_math -lm -Wl,--end-group -L"../cmsis/linkerScripts" -L"../src/ASF/thirdparty/CMSIS/Lib/GCC" -Wl,--gc-sections -mcpu=cortex-m0plus -Wl,--entry=Reset_Handler -Wl,--cref -mthumb -T../src/ASF/sam0/utils/linker_scripts/samd20/gcc/samd20j18_flash.ld
    Finished building target: The first project with UART.elf
    "D:\Program Files (x86)\Atmel\Atmel Toolchain\ARM GCC\Native\4.8.1443\arm-gnu-toolchain\bin\arm-none-eabi-objcopy.exe" -O binary "The first project with UART.elf" "The first project with UART.bin"
    "D:\Program Files (x86)\Atmel\Atmel Toolchain\ARM GCC\Native\4.8.1443\arm-gnu-toolchain\bin\arm-none-eabi-objcopy.exe" -O ihex -R .eeprom -R .fuse -R .lock -R .signature "The first project with UART.elf" "The first project with UART.hex"
    "D:\Program Files (x86)\Atmel\Atmel Toolchain\ARM GCC\Native\4.8.1443\arm-gnu-toolchain\bin\arm-none-eabi-objcopy.exe" -j .eeprom --set-section-flags=.eeprom=alloc,load --change-section-lma .eeprom=0 --no-change-warnings -O binary "The first project with UART.elf" "The first project with UART.eep" || exit 0
    "D:\Program Files (x86)\Atmel\Atmel Toolchain\ARM GCC\Native\4.8.1443\arm-gnu-toolchain\bin\arm-none-eabi-objdump.exe" -h -S "The first project with UART.elf" > "The first project with UART.lss"
    "D:\Program Files (x86)\Atmel\Atmel Toolchain\ARM GCC\Native\4.8.1443\arm-gnu-toolchain\bin\arm-none-eabi-objcopy.exe" -O srec -R .eeprom -R .fuse -R .lock -R .signature "The first project with UART.elf" "The first project with UART.srec"
    "D:\Program Files (x86)\Atmel\Atmel Toolchain\ARM GCC\Native\4.8.1443\arm-gnu-toolchain\bin\arm-none-eabi-size.exe" "The first project with UART.elf"
    text data bss dec hex filename
    5048 4 8260 13312 3400 The first project with UART.elf
    Done executing task "RunCompilerTask".
    Task "RunOutputFileVerifyTask"
    Program Memory Usage : 5052 bytes 1,9 % Full
    Data Memory Usage : 8264 bytes 25,2 % Full
    Done executing task "RunOutputFileVerifyTask".
    Done building target "CoreBuild" in project "The first project with UART.cproj".
    Target "PostBuildEvent" skipped, due to false condition; ('$(PostBuildEvent)' != '') was evaluated as ('' != '').
    Target "Build" in file "D:\Program Files (x86)\Atmel\Atmel Studio 6.2\Vs\Avr.common.targets" from project "C:\Users\Donnie\Downloads\140512-11\The first project with UART\The first project with UART\The first project with UART.cproj" (entry point):
    Done building target "Build" in project "The first project with UART.cproj".
    Done building project "The first project with UART.cproj".

    Build succeeded.
    ========== Build: 1 succeeded or up-to-date, 0 failed, 0 skipped ==========

    Projects Build Summary
    ----------------------
    Time | Status | Errors |Warngs/info| Project [Config|platform]
    -------------|-----------|-----------|-----------|---------------------------------------------------------------------------------------------------
    00:02:13.93 | Succeeded |0 |22 | The first project with UART\The first project with UART.cproj [Debug|ARM]

    Total Time Elapsed 00:02:17.01

    Warning 1 no previous prototype for 'configure_port_pins' [-Wmissing-prototypes] C:\Users\Donnie\Downloads\140512-11\The first project with UART\The first project with UART\src\main.c 8 6 The first project with UART
    Warning 2 no previous prototype for 'configure_usart' [-Wmissing-prototypes] C:\Users\Donnie\Downloads\140512-11\The first project with UART\The first project with UART\src\main.c 30 6 The first project with UART
    Warning 3 passing argument 2 of 'usart_read_buffer_wait' from incompatible pointer type [enabled by default] C:\Users\Donnie\Downloads\140512-11\The first project with UART\The first project with UART\src\main.c 59 2 The first project with UART
    Message 4 expected 'uint8_t *' but argument is of type 'uint8_t (*)[11]' C:\Users\Donnie\Downloads\140512-11\The first project with UART\The first project with UART\src\ASF\sam0\drivers\sercom\usart\usart.h 940 18 The first project with UART
    Warning 5 pointer targets in passing argument 1 of 'strcmp' differ in signedness [-Wpointer-sign] C:\Users\Donnie\Downloads\140512-11\The first project with UART\The first project with UART\src\main.c 61 3 The first project with UART
    Message 6 expected 'const char *' but argument is of type 'uint8_t *' d:\program files (x86)\atmel\atmel toolchain\arm gcc\native\4.8.1443\arm-gnu-toolchain\arm-none-eabi\include\string.h 28 6 The first project with UART
    Warning 7 pointer targets in passing argument 2 of 'strcmp' differ in signedness [-Wpointer-sign] C:\Users\Donnie\Downloads\140512-11\The first project with UART\The first project with UART\src\main.c 61 3 The first project with UART
    Message 8 expected 'const char *' but argument is of type 'uint8_t *' d:\program files (x86)\atmel\atmel toolchain\arm gcc\native\4.8.1443\arm-gnu-toolchain\arm-none-eabi\include\string.h 28 6 The first project with UART
    Warning 9 passing argument 2 of 'usart_write_buffer_wait' from incompatible pointer type [enabled by default] C:\Users\Donnie\Downloads\140512-11\The first project with UART\The first project with UART\src\main.c 64 4 The first project with UART
    Message 10 expected 'const uint8_t *' but argument is of type 'uint8_t (*)[3]' C:\Users\Donnie\Downloads\140512-11\The first project with UART\The first project with UART\src\ASF\sam0\drivers\sercom\usart\usart.h 935 18 The first project with UART
    Warning 11 pointer targets in passing argument 1 of 'strcmp' differ in signedness [-Wpointer-sign] C:\Users\Donnie\Downloads\140512-11\The first project with UART\The first project with UART\src\main.c 66 3 The first project with UART
    Message 12 expected 'const char *' but argument is of type 'uint8_t *' d:\program files (x86)\atmel\atmel toolchain\arm gcc\native\4.8.1443\arm-gnu-toolchain\arm-none-eabi\include\string.h 28 6 The first project with UART
    Warning 13 pointer targets in passing argument 2 of 'strcmp' differ in signedness [-Wpointer-sign] C:\Users\Donnie\Downloads\140512-11\The first project with UART\The first project with UART\src\main.c 66 3 The first project with UART
    Message 14 expected 'const char *' but argument is of type 'uint8_t *' d:\program files (x86)\atmel\atmel toolchain\arm gcc\native\4.8.1443\arm-gnu-toolchain\arm-none-eabi\include\string.h 28 6 The first project with UART
    Warning 15 passing argument 2 of 'usart_write_buffer_wait' from incompatible pointer type [enabled by default] C:\Users\Donnie\Downloads\140512-11\The first project with UART\The first project with UART\src\main.c 69 4 The first project with UART
    Message 16 expected 'const uint8_t *' but argument is of type 'uint8_t (*)[3]' C:\Users\Donnie\Downloads\140512-11\The first project with UART\The first project with UART\src\ASF\sam0\drivers\sercom\usart\usart.h 935 18 The first project with UART
    Warning 17 pointer targets in passing argument 1 of 'strcmp' differ in signedness [-Wpointer-sign] C:\Users\Donnie\Downloads\140512-11\The first project with UART\The first project with UART\src\main.c 71 3 The first project with UART
    Message 18 expected 'const char *' but argument is of type 'uint8_t *' d:\program files (x86)\atmel\atmel toolchain\arm gcc\native\4.8.1443\arm-gnu-toolchain\arm-none-eabi\include\string.h 28 6 The first project with UART
    Warning 19 pointer targets in passing argument 2 of 'strcmp' differ in signedness [-Wpointer-sign] C:\Users\Donnie\Downloads\140512-11\The first project with UART\The first project with UART\src\main.c 71 3 The first project with UART
    Message 20 expected 'const char *' but argument is of type 'uint8_t *' d:\program files (x86)\atmel\atmel toolchain\arm gcc\native\4.8.1443\arm-gnu-toolchain\arm-none-eabi\include\string.h 28 6 The first project with UART
    Warning 21 passing argument 2 of 'usart_write_buffer_wait' from incompatible pointer type [enabled by default] C:\Users\Donnie\Downloads\140512-11\The first project with UART\The first project with UART\src\main.c 82 2 The first project with UART
    Message 22 expected 'const uint8_t *' but argument is of type 'uint8_t (*)[2]' C:\Users\Donnie\Downloads\140512-11\The first project with UART\The first project with UART\src\ASF\sam0\drivers\sercom\usart\usart.h 935 18 The first project with UART

Viele Grüße,
Ag
ag
 
Posts: 532
Joined: Thu Jan 02, 2014 10:37 am

Re: Teil 2: SRC-Download und Listing im Heft unterschiedlich

Postby ge1ge » Mon Mar 02, 2015 10:01 am

Hallo ag,

irgendwie sieht bei mir der Inhalt in Output nach der Kompiierung von main.c (22.12.2014) ganz anders aus. Da bei mir ein Error noch gemeldet wurde (in der Error List sicihtbar), wurde "Projects Build Summary" gar nicht in Output erzeugt.

Ich benutze die ASF (3.21.0).

Ich habe kompiliert mit "Start without debugging"
Dann sah ich die Meldungen mit einem error in der Error List und es erschien ein Fenster mit:
"There were build errors. Would you like to continue and run the last successful build"
Ich habe als Antwort yes und no probiert, aber das build wurde in beiden Fällen abgebrochen und der Inhalt des Output war jedesmal gleich.

Den Outputinhalt habe ich hier einfach in "code" eingefügt, damit der Thread nicht so lang wird:
Code: Select all
------ Build started: Project: Elektor_Program_1_UART, Configuration: Debug ARM ------
Build started.
Project "Elektor_Program_1_UART.cproj" (default targets):
Target "PreBuildEvent" skipped, due to false condition; ('$(PreBuildEvent)'!='') was evaluated as (''!='').
Target "CoreBuild" in file "C:\Program Files (x86)\Atmel\Atmel Studio 6.2\Vs\Compiler.targets" from project "C:\Users\uid02093\Documents\Atmel Studio\6.2\Elektor_Program_1_UART\Elektor_Program_1_UART\Elektor_Program_1_UART.cproj" (target "Build" depends on it):
   Task "RunCompilerTask"
      Shell Utils Path C:\Program Files (x86)\Atmel\Atmel Studio 6.2\shellUtils
      C:\Program Files (x86)\Atmel\Atmel Studio 6.2\shellUtils\make.exe all
      Building file: ../src/main.c
      Invoking: ARM/GNU C Compiler : 4.8.4
      "C:\Program Files (x86)\Atmel\Atmel Toolchain\ARM GCC\Native\4.8.1437\arm-gnu-toolchain\bin\arm-none-eabi-gcc.exe"  -x c -mthumb -D__SAMD20J18__ -DDEBUG -D__SAMD20J18__ -DARM_MATH_CM0=true -DBOARD=SAMD20_XPLAINED_PRO -DUSART_CALLBACK_MODE=true  -I"../common2/applications/xplained_pro_user_application/samd20j18_samd20_xplained_pro/config" -I"../src/ASF/sam0/utils/header_files" -I"../src/ASF/sam0/drivers/system/power/power_sam_d_r" -I"../src/ASF/common/utils" -I"../src/ASF/sam0/drivers/system/pinmux" -I"../src/ASF/sam0/drivers/system/power" -I"../src/ASF/sam0/drivers/system/reset/reset_sam_d_r" -I"../src/ASF/common/boards" -I"../src/ASF/sam0/drivers/port" -I"../src/ASF/sam0/drivers/system/clock/clock_samd20" -I"../src/ASF/sam0/boards" -I"../src/ASF/sam0/utils" -I"../src/ASF/thirdparty/CMSIS/Include" -I"../src/config" -I"../src/ASF/thirdparty/CMSIS/Lib/GCC" -I"../src/ASF/sam0/drivers/system/reset" -I"../src/ASF/sam0/drivers/system/interrupt/system_interrupt_samd20" -I"../src" -I"../src/ASF/sam0/boards/samd20_xplained_pro" -I"../src/ASF/sam0/utils/cmsis/samd20/include" -I"../src/ASF/sam0/utils/preprocessor" -I"../src/ASF/sam0/utils/cmsis/samd20/source" -I"../src/ASF/sam0/drivers/system" -I"../src/ASF/sam0/drivers/system/clock" -I"../src/ASF/sam0/drivers/system/interrupt" -I"../src/ASF/sam0/drivers/sercom" -I"../src/ASF/sam0/drivers/sercom/usart"  -O1 -fdata-sections -ffunction-sections -mlong-calls -g3 -Wall -mcpu=cortex-m0plus -c -pipe -fno-strict-aliasing -Wall -Wstrict-prototypes -Wmissing-prototypes -Werror-implicit-function-declaration -Wpointer-arith -std=gnu99 -ffunction-sections -fdata-sections -Wchar-subscripts -Wcomment -Wformat=2 -Wimplicit-int -Wmain -Wparentheses -Wsequence-point -Wreturn-type -Wswitch -Wtrigraphs -Wunused -Wuninitialized -Wunknown-pragmas -Wfloat-equal -Wundef -Wshadow -Wbad-function-cast -Wwrite-strings -Wsign-compare -Waggregate-return  -Wmissing-declarations -Wformat -Wmissing-format-attribute -Wno-deprecated-declarations -Wpacked -Wredundant-decls -Wnested-externs -Wlong-long -Wunreachable-code -Wcast-align --param max-inline-insns-single=500 -MD -MP -MF "src/main.d" -MT"src/main.d" -MT"src/main.o"   -o "src/main.o" "../src/main.c"
C:\Users\uid02093\Documents\Atmel Studio\6.2\Elektor_Program_1_UART\Elektor_Program_1_UART\src\main.c(8,6): warning: no previous prototype for 'configure_port_pins' [-Wmissing-prototypes]
       void configure_port_pins(void)                             //setup of the configuration of the pins
            ^
C:\Users\uid02093\Documents\Atmel Studio\6.2\Elektor_Program_1_UART\Elektor_Program_1_UART\src\main.c(30,6): warning: no previous prototype for 'configure_usart' [-Wmissing-prototypes]
       void configure_usart(void)                            //setup of the configuration of UART
            ^
      ../src/main.c: In function 'main':
C:\Users\uid02093\Documents\Atmel Studio\6.2\Elektor_Program_1_UART\Elektor_Program_1_UART\src\main.c(59,3): warning: passing argument 2 of 'usart_read_buffer_wait' from incompatible pointer type [enabled by default]
         if (usart_read_buffer_wait(&usart_instance, &string1, 10) == STATUS_OK)   //if the UART received 10 bytes
         ^
      In file included from ../src/asf.h:76:0,
                       from ../src/main.c:1:
C:\Users\uid02093\Documents\Atmel Studio\6.2\Elektor_Program_1_UART\Elektor_Program_1_UART\src\ASF\sam0\drivers\sercom\usart\usart.h(944,18): info: expected 'uint8_t *' but argument is of type 'uint8_t (*)[11]'
       enum status_code usart_read_buffer_wait(
                        ^
C:\Users\uid02093\Documents\Atmel Studio\6.2\Elektor_Program_1_UART\Elektor_Program_1_UART\src\main.c(61,4): error: implicit declaration of function 'strcmp' [-Werror=implicit-function-declaration]
          if (strcmp(string1, string2) == 0)                     //If UART received "greenLED 1", put the green LED on
          ^
C:\Users\uid02093\Documents\Atmel Studio\6.2\Elektor_Program_1_UART\Elektor_Program_1_UART\src\main.c(64,5): warning: passing argument 2 of 'usart_write_buffer_wait' from incompatible pointer type [enabled by default]
           while(usart_write_buffer_wait(&usart_instance, &string5, 2) != STATUS_OK){} //and send OK
           ^
      In file included from ../src/asf.h:76:0,
                       from ../src/main.c:1:
C:\Users\uid02093\Documents\Atmel Studio\6.2\Elektor_Program_1_UART\Elektor_Program_1_UART\src\ASF\sam0\drivers\sercom\usart\usart.h(939,18): info: expected 'const uint8_t *' but argument is of type 'uint8_t (*)[3]'
       enum status_code usart_write_buffer_wait(
                        ^
C:\Users\uid02093\Documents\Atmel Studio\6.2\Elektor_Program_1_UART\Elektor_Program_1_UART\src\main.c(69,5): warning: passing argument 2 of 'usart_write_buffer_wait' from incompatible pointer type [enabled by default]
           while(usart_write_buffer_wait(&usart_instance, &string5, 2) != STATUS_OK){} //and send OK
           ^
      In file included from ../src/asf.h:76:0,
                       from ../src/main.c:1:
C:\Users\uid02093\Documents\Atmel Studio\6.2\Elektor_Program_1_UART\Elektor_Program_1_UART\src\ASF\sam0\drivers\sercom\usart\usart.h(939,18): info: expected 'const uint8_t *' but argument is of type 'uint8_t (*)[3]'
       enum status_code usart_write_buffer_wait(
                        ^
C:\Users\uid02093\Documents\Atmel Studio\6.2\Elektor_Program_1_UART\Elektor_Program_1_UART\src\main.c(82,4): warning: passing argument 2 of 'usart_write_buffer_wait' from incompatible pointer type [enabled by default]
          while(usart_write_buffer_wait(&usart_instance, &string6, 2) != STATUS_OK){}   //new line
          ^
      In file included from ../src/asf.h:76:0,
                       from ../src/main.c:1:
C:\Users\uid02093\Documents\Atmel Studio\6.2\Elektor_Program_1_UART\Elektor_Program_1_UART\src\ASF\sam0\drivers\sercom\usart\usart.h(939,18): info: expected 'const uint8_t *' but argument is of type 'uint8_t (*)[2]'
       enum status_code usart_write_buffer_wait(
                        ^
      cc1.exe: some warnings being treated as errors
      make: *** [src/main.o] Error 1
   Done executing task "RunCompilerTask" -- FAILED.
Done building target "CoreBuild" in project "Elektor_Program_1_UART.cproj" -- FAILED.
Done building project "Elektor_Program_1_UART.cproj" -- FAILED.

Build FAILED.
========== Build: 0 succeeded or up-to-date, 1 failed, 0 skipped ==========


Wenn ich in Main.c
#include <string.h>
einfüge ist der error weg.

In string.h sehe ich folgende Zeile mit "strcmp":
Code: Select all
int    _EXFUN(strcmp,(const char *, const char *));
ge1ge
 
Posts: 11
Joined: Fri Jan 30, 2015 8:54 pm

Re: Teil 2: SRC-Download und Listing im Heft unterschiedlich

Postby ag » Mon Mar 02, 2015 1:20 pm

Hallo Gerhard,

in mein vorigen Post hatte ich nur die letzten Zeilen von Output aufgelistet, nur als Beweis für erfolgreiches Kompilieren. Ich habe nun deinen Output mit meinem verglichen. Sie entsprechen einander bis zu folgende Zeilen:

Bei dir:
    C:\Users\uid02093\Documents\Atmel Studio\6.2\Elektor_Program_1_UART\Elektor_Program_1_UART\src\ASF\sam0\drivers\sercom\usart\usart.h(944,18): info: expected 'uint8_t *' but argument is of type 'uint8_t (*)[11]'
    enum status_code usart_read_buffer_wait(
    ^
    C:\Users\uid02093\Documents\Atmel Studio\6.2\Elektor_Program_1_UART\Elektor_Program_1_UART\src\main.c(61,4): error: implicit declaration of function 'strcmp' [-Werror=implicit-function-declaration]
    if (strcmp(string1, string2) == 0) //If UART received "greenLED 1", put the green LED on
    ^
und bei mir:
    C:\Users\Donnie\Downloads\140512-11\The first project with UART\The first project with UART\src\ASF\sam0\drivers\sercom\usart\usart.h(940,18): info: expected 'uint8_t *' but argument is of type 'uint8_t (*)[11]'
    enum status_code usart_read_buffer_wait(
    ^
    C:\Users\Donnie\Downloads\140512-11\The first project with UART\The first project with UART\src\main.c(61,3): warning: pointer targets in passing argument 1 of 'strcmp' differ in signedness [-Wpointer-sign]
    if (strcmp(string1, string2) == 0) //If UART received "greenLED 1", put the green LED on
    ^
    In file included from d:\program files (x86)\atmel\atmel toolchain\arm gcc\native\4.8.1443\arm-gnu-toolchain\arm-none-eabi\include\stdio.h:29:0,
    from ../src/ASF/sam0/utils/compiler.h:66,
    from ../src/asf.h:56,
    from ../src/main.c:1:

Leider kann ich nicht erkennen, warum bei mir ein Warnung kommt wo bei dir ein Fehler ausgewiesen wird. Merkwürdig finde ich die unterschiedliche Angaben für Zeile/Position.

Vielleich kann Viacheslav hier weiterhelfen.

Viele Grüße,
Ag
ag
 
Posts: 532
Joined: Thu Jan 02, 2014 10:37 am

Re: Teil 2: SRC-Download und Listing im Heft unterschiedlich

Postby slagromo » Tue Mar 03, 2015 6:31 pm

Hallo ag,
Hallo ge1ge,


haben Sie die richtige Version des Ordners heruntergeladen? Diese ist ja erst seit gestern zum Download verfügbar. Dort sollten Sie keine Fehlermeldungen (nur die üblichen Warnungen) zu Gesicht bekommen.



Mit freundlichen Grüßen,

Viacheslav Gromov
slagromo
 
Posts: 21
Joined: Tue Dec 30, 2014 10:13 am

Re: Teil 2: SRC-Download und Listing im Heft unterschiedlich

Postby ge1ge » Wed Mar 04, 2015 1:38 pm

Hallo Viacheslav,

der ERROR erschien bei mir nicht mehr, als ich
#include <string.h>
eingefügt habe, dass Du ja auch in deiner "main.c vom 26.02.2015 16:22" gemacht hast.

Die Diskussion mit ag entstand, da bei ihm kein ERROR, sondern nur ein Warning angezeigt wurde und wir wollten herausfinden woran es lag.

Schöne Grüße
Gerhard
ge1ge
 
Posts: 11
Joined: Fri Jan 30, 2015 8:54 pm

Previous

Return to ARM-COURSE

Who is online

Users browsing this forum: No registered users and 1 guest