project-chip / connectedhomeip

Matter (formerly Project CHIP) creates more connections between more objects, simplifying development for manufacturers and increasing compatibility for consumers, guided by the Connectivity Standards Alliance.
https://buildwithmatter.com
Apache License 2.0
7.45k stars 1.99k forks source link

[1.1] [K32W] [NXP] [lighting-app] lighting-app example compilation issue #28776

Open gokul-2000 opened 1 year ago

gokul-2000 commented 1 year ago

Reproduction steps

CASE 1:

I followed the guide given at link: lighting-app, v1.1-branch

I used NXP K32W USB dongle as matter end-device to run lighting-app example.

As per the guide, I used NXP SDK v2.6.11 and lighting-app example from connectedhomeip.

In that, I faced compilation errors for the unused variables and function parameters not matching, which I resolved but still, I am facing below mentioned error.

ninja -C out/debug
ninja: Entering directory `out/debug'
[1/8] ld ./chip-k32w0x-light-example
FAILED: chip-k32w0x-light-example chip-k32w0x-light-example.map 
arm-none-eabi-g++ -T../../third_party/connectedhomeip/examples/platform/nxp/k32w/k32w0/app/ldscripts/chip-k32w0x-linker.ld -Wl,-print-memory-usage -Wl,--defsym -Wl,__app_load_address__=0x4000 -Wl,--defsym -Wl,__app_stated_size__=0x99200 -march=armv7e-m -mcpu=cortex-m4 -mfloat-abi=soft -mthumb -Og --specs=nosys.specs --specs=nano.specs -Werror -Wl,--fatal-warnings -fdiagnostics-color -Wl,--gc-sections -T ../../third_party/connectedhomeip/third_party/pigweed/repo/pw_tokenizer/pw_tokenizer_linker_sections.ld -Wl,--wrap=malloc -Wl,--wrap=free -Wl,--wrap=realloc -Wl,--wrap=calloc -Wl,--wrap=MemoryAlloc -Wl,--wrap=_malloc_r -Wl,--wrap=_realloc_r -Wl,--wrap=_free_r -Wl,--wrap=_calloc_r -L../../third_party/connectedhomeip/third_party/pigweed/repo/pw_tokenizer -Wl,-Map,./chip-k32w0x-light-example.map @./chip-k32w0x-light-example.rsp -o ./chip-k32w0x-light-example
/home/gokul/BAE/matter-migration/matter/.environment/cipd/packages/arm/bin/../lib/gcc/arm-none-eabi/12.2.1/../../../../arm-none-eabi/bin/ld: ./chip-k32w0x-light-example section .text' will not fit in region Flash640'
/home/gokul/BAE/matter-migration/matter/.environment/cipd/packages/arm/bin/../lib/gcc/arm-none-eabi/12.2.1/../../../../arm-none-eabi/bin/ld: region `Flash640' overflowed by 97976 bytes
Memory region         Used Size  Region Size  %age Used
        Flash640:      725176 B     627200 B    115.62%
     SCRATCH_RAM:          1 KB         1 KB    100.00%
            RAM0:       83536 B        87 KB     93.77%
            RAM1:         64 KB        64 KB    100.00%
collect2: error: ld returned 1 exit status
ninja: build stopped: subcommand failed.

CASE 2:

I checkout the master branch commit id: 40fe1c6ac841a1520ac7c3885451674562491e36

I used NXP K32W USB dongle as matter end-device to run lighting-app example.

Followed link: https://github.com/project-chip/connectedhomeip/tree/40fe1c6ac841a1520ac7c3885451674562491e36

As per the guide, I used NXP SDK v2.6.11 and lighting-app example from connectedhomeip, I successfully compiled the example application.

After that, I flashed the bootloader binary(k32w061dk6_ssbl.bin) and lighting-app binary(chip-k32w0x-light-example.bin), but it's not displaying logs on the terminal which can verify that it's working or not.


Let me know in case of more information is required.

Thanks in advance for any support.

Bug prevalence

Consistent

GitHub hash of the SDK that was being used

v1.1-branch

Platform

k32w

Platform Version(s)

No response

Type

Platform Issue

Anything else?

No response

gokul-2000 commented 1 year ago

Hi @bzbarsky-apple,

Any help or guide would be much appreciable.

bzbarsky-apple commented 1 year ago

For your case 1, you're running out of space on the device, right? From the log you pasted:

Region `Flash640' overflowed by 97976 bytes

Past that, I've never tried actually compiling for k32w. You might want to ask @doru91 .

gokul-2000 commented 1 year ago

Thanks for the response @bzbarsky-apple

I want to use K32W061 SoC with another custom development board supporting K32W061 hardware instead of the NXP K32W061 DK6 development kit.

Any help or guidance would be much appreciated!! @doru91 @bzbarsky-apple

bzbarsky-apple commented 1 year ago

@gokul-2000 I have no idea, sorry...

mihai-ignat commented 6 months ago

Hello, @gokul-2000 .

Regarding the initial post, is case 1 still an issue? For case 2, the binary generated by the build is not suitable for K32W0 USB dongle. It was made for the K32W061DK6 board. Can you please try using K32W061DK6?

And for the last comment, regarding hardware related changes, the file defining the used pins and their function is pin_mux.c, which can be found in the K32W061 SDK, at path boards/k32w061dk6/wireless_examples/openthread/reed/bm/pin_mux.c. This is where you need to start in order to adapt to your hardware configuration.

For faster responses, I suggest using the NXP Wireless Connectivity community.

BR, Mihai