[Using SparkFun Edge Board with Ambiq Apollo3 SDK] Succeeded in example2 but failed with examepl1

Hello friends,

Following your instruction (tutorials/using-sparkfun-edge-board-wit … troduction), I installed all the components to build example apps that complie with Ambiq apollo3 SDK and run on SparkFun Edge board. The compilation process succeeded in 2 examples, but falied with the other :frowning:

I am sending you 2 compilation logs as below. The first, built for example2, was successful. The 2nd, built for example1, was failure.

[Log for build example2]

8a3062bee638:/home/apollo3/AmbiqSuite-Rel2.0.0/boards/SparkFun_Edge_BSP/examples/example2_dual_mic_dma/gcc# make bootload

…/…/…/…/…/tools/apollo3_scripts/create_cust_image_blob.py --bin bin/example2_dual_mic_dma.bin --load-address 0xC000 --magic-num 0xCB -o bin/main_nonsecure_ota --version 0x0

Header Size = 0x80

original app_size 0x331c ( 13084 )

load_address 0xc000 ( 49152 )

app_size 0x331c ( 13084 )

w0 = 0xcb00339c

Security Value 0x10

w2 = 0x10008080

addrWord = 0xc000

versionKeyWord = 0x0

child0/feature = 0xffffffff

child1 = 0xffffffff

crc = 0x4bfc9037

Writing to file bin/main_nonsecure_ota.bin

…/…/…/…/…/tools/apollo3_scripts/create_cust_wireupdate_blob.py --load-address 0x20000 --bin bin/main_nonsecure_ota.bin -i 6 -o bin/main_nonsecure_wire --options 0x1

Header Size = 0x60

app_size 0x339c ( 13212 )

Writing to file bin/main_nonsecure_wire.bin

Image from 0x0 to 0x339c will be loaded at 0x20000

…/…/…/bsp/tools/uart_wired_update_sparkfun.py -b 921600 /dev/ttyUSB0 -r 1 -f bin/main_nonsecure_wire.bin -i 6

Connecting with Corvette over serial port /dev/ttyUSB0…

Sending Hello.

Received response for Hello

Received Status

length = 0x58

version = 0x3

Max Storage = 0x4ffa0

Status = 0x2

State = 0x7

AMInfo =

0x1

0xff2da3ff

0x55fff

0x1

0x49f40003

0xffffffff

0xffffffff

0xffffffff

0xffffffff

0xffffffff

0xffffffff

0xffffffff

0xffffffff

0xffffffff

0xffffffff

0xffffffff

Sending OTA Descriptor = 0xfe000

Sending Update Command.

number of updates needed = 1

Sending block of size 0x33fc from 0x0 to 0x33fc

Sending Data Packet of length 8180

Sending Data Packet of length 5128

Sending Reset Command.

Done.

[Log for build example1]

8a3062bee638:/home/apollo3/AmbiqSuite-Rel2.0.0/boards/SparkFun_Edge_BSP/examples/example1_edge_test/gcc# make bootload

Compiling gcc …/src/main.c

Compiling gcc …/…/…/…/…/devices/am_devices_led.c

Compiling gcc …/…/…/…/…/utils/am_util_delay.c

Compiling gcc …/…/…/…/…/utils/am_util_faultisr.c

Compiling gcc …/…/…/…/…/utils/am_util_stdio.c

Compiling gcc startup_gcc.c

Compiling gcc …/src/tf_adc/tf_adc.c

…/src/tf_adc/tf_adc.c: In function ‘am_adc_isr’:

…/src/tf_adc/tf_adc.c:62:58: warning: passing argument 2 of ‘am_hal_adc_samples_read’ makes pointer from integer without a cast [-Wint-conversion]

62 | true,

| ^~~~

| |

| int

In file included from …/…/…/…/…/mcu/apollo3/am_mcu_apollo.h:132,

from …/src/tf_adc/tf_adc.c:1:

…/…/…/…/…/mcu/apollo3/hal/am_hal_adc.h:618:53: note: expected ‘uint32_t *’ {aka ‘long unsigned int *’} but argument is of type ‘int’

618 | uint32_t *pui32InSampleBuffer,

| ^~~~~~~~~

…/src/tf_adc/tf_adc.c:64:58: warning: passing argument 4 of ‘am_hal_adc_samples_read’ from incompatible pointer type [-Wincompatible-pointer-types]

64 | &ui32NumSamples,

| ^~~~~~~~~~~~~~~

| |

| uint32_t * {aka long unsigned int *}

In file included from …/…/…/…/…/mcu/apollo3/am_mcu_apollo.h:132,

from …/src/tf_adc/tf_adc.c:1:

…/…/…/…/…/mcu/apollo3/hal/am_hal_adc.h:620:64: note: expected ‘am_hal_adc_sample_t *’ {aka ‘struct *’} but argument is of type ‘uint32_t *’ {aka ‘long unsigned int *’}

620 | am_hal_adc_sample_t *pui32OutBuffer);

| ~~~~~~~~~^~

…/src/tf_adc/tf_adc.c:61:38: error: too many arguments to function ‘am_hal_adc_samples_read’

61 | if (AM_HAL_STATUS_SUCCESS != am_hal_adc_samples_read(g_ADCHandle,

| ^~~~~~~~~~~~~~~~~~~~~~~

In file included from …/…/…/…/…/mcu/apollo3/am_mcu_apollo.h:132,

from …/src/tf_adc/tf_adc.c:1:

…/…/…/…/…/mcu/apollo3/hal/am_hal_adc.h:617:19: note: declared here

617 | extern uint32_t am_hal_adc_samples_read(void *pHandle,

| ^~~~~~~~~~~~~~~~~~~~~~~

Makefile:163: recipe for target ‘bin/tf_adc.o’ failed

make: *** [bin/tf_adc.o] Error 1

Could you take a look into?

Thanks in advance,

Now the compilation works, and the .bin works on the board with all 4 leds turned on :slight_smile: 2 lines in 2 files were changed.

In AmbiqSuite-Rel2.0.0/boards/SparkFun_Edge_BSP/examples/example1_edge_test/Makeflie, modified line 42 as:

“SWROOT?=…/…/…/…”

In AmbiqSuite-Rel2.0.0/boards/SparkFun_Edge_BSP/examples/example1_edge_test/src/tf_adc/tf_adc.c, commented line 62 as:

“// true,“

That’s all.

Best,

vvv@DESKTOP-1OKDS8Q MINGW64 /f/apolloSDK/AmbiqSuite-Rel2.0.0/boards/SparkFun_Edge_BSP/examples/example1_edge_test/gcc

$ make bootload

…/…/…/…/…/tools/apollo3_scripts/create_cust_image_blob.py --bin bin/example1_edge_test.bin --load-address 0xC000 --magic-num 0xCB -o bin/main_nonsecure_ota --version 0x0

env: ‘python3’: Permission denied

make: *** [Makefile:193: wired_update] Error 126

Check that you have access to ‘python3’ on the command line. In your shell try ‘python’, ‘python3’, and see which work and which versions of python are associated with each. If there is no python3 you will want to copy the ‘python’ executable that came with your Python3 installation and call it ‘python3’ (make sure it is in path). If you have done that or ‘python3’ works in the shell then you may just need to give executable access - aka ‘sudo chmod +x ./path_to_python3_executable/python3’