-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnRF52840_LR11xx_driver_v010000.diff
15699 lines (15639 loc) · 685 KB
/
nRF52840_LR11xx_driver_v010000.diff
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
diff -urN '--exclude=.git' '--exclude=build' '--exclude=test_lr1110' '--exclude=gnss_field_test' '--exclude=lr11xx_private' '--exclude=sx126x' '--exclude=lcd1602_template_subghz' '--exclude=wakeup_test' '--exclude=.github' '--exclude=check_swdr001' sidewalk/doc/ncs_links.rst gitlab_sidewalk/doc/ncs_links.rst
--- sidewalk/doc/ncs_links.rst 2023-11-09 11:04:08.268734741 -0800
+++ gitlab_sidewalk/doc/ncs_links.rst 2023-11-01 08:09:54.855151527 -0700
@@ -1,16 +1,16 @@
-.. _nRF Connect SDK: https://developer.nordicsemi.com/nRF_Connect_SDK/doc/2.5.0-rc1/nrf/index.html
-.. _nrf52840 DK: https://developer.nordicsemi.com/nRF_Connect_SDK/doc/2.5.0-rc1/nrf/config_and_build/board_support.html#boards-included-in-sdk-zephyr
-.. _nrf5340 DK: https://developer.nordicsemi.com/nRF_Connect_SDK/doc/2.5.0-rc1/nrf/config_and_build/board_support.html#boards-included-in-sdk-zephyr
-.. _Getting started with nRF52 Series: https://developer.nordicsemi.com/nRF_Connect_SDK/doc/2.5.0-rc1/nrf/working_with_nrf/nrf52/gs.html
-.. _Getting started with nRF53 Series: https://developer.nordicsemi.com/nRF_Connect_SDK/doc/2.5.0-rc1/nrf/working_with_nrf/nrf53/nrf5340_gs.html
-.. _Zephyr toolchain: https://developer.nordicsemi.com/nRF_Connect_SDK/doc/2.5.0-rc1/nrf/gs_installing.html#install-a-toolchain
-.. _Installing automatically: https://developer.nordicsemi.com/nRF_Connect_SDK/doc/2.5.0-rc1/nrf/gs_assistant.html#installing-automatically
-.. _Installing manually: https://developer.nordicsemi.com/nRF_Connect_SDK/doc/2.5.0-rc1/nrf/gs_installing.html#install-the-required-tools
-.. _nRF Connect SDK Getting started: https://developer.nordicsemi.com/nRF_Connect_SDK/doc/2.5.0-rc1/nrf/getting_started.html
-.. _nRF52840dk_nrf52840: https://developer.nordicsemi.com/nRF_Connect_SDK/doc/2.5.0-rc1/zephyr/boards/arm/nrf52840dk_nrf52840/doc/index.html
-.. _nrf5340dk_nrf5340: https://developer.nordicsemi.com/nRF_Connect_SDK/doc/2.5.0-rc1/zephyr/boards/arm/nrf5340dk_nrf5340/doc/index.html#nrf5340dk-nrf5340
-.. _Building and programming an application: https://developer.nordicsemi.com/nRF_Connect_SDK/doc/2.5.0-rc1/nrf/getting_started/programming.html#gs-programming
-.. _Testing and debugging an application: https://developer.nordicsemi.com/nRF_Connect_SDK/doc/2.5.0-rc1/nrf/getting_started/testing.html#gs-testing
-.. _Bootloader and DFU solutions for NCS: https://developer.nordicsemi.com/nRF_Connect_SDK/doc/2.5.0-rc1/nrf/app_bootloaders.html
-.. _Zephyr SMP Server: https://developer.nordicsemi.com/nRF_Connect_SDK/doc/2.5.0-rc1/zephyr/services/device_mgmt/ota.html#smp-server
-.. _NCS testing applications: https://developer.nordicsemi.com/nRF_Connect_SDK/doc/2.5.0-rc1/nrf/gs_testing.html
+.. _nRF Connect SDK: https://developer.nordicsemi.com/nRF_Connect_SDK/doc/2.5.0/nrf/index.html
+.. _nrf52840 DK: https://developer.nordicsemi.com/nRF_Connect_SDK/doc/2.5.0/nrf/config_and_build/board_support.html#boards-included-in-sdk-zephyr
+.. _nrf5340 DK: https://developer.nordicsemi.com/nRF_Connect_SDK/doc/2.5.0/nrf/config_and_build/board_support.html#boards-included-in-sdk-zephyr
+.. _Getting started with nRF52 Series: https://developer.nordicsemi.com/nRF_Connect_SDK/doc/2.5.0/nrf/working_with_nrf/nrf52/gs.html
+.. _Getting started with nRF53 Series: https://developer.nordicsemi.com/nRF_Connect_SDK/doc/2.5.0/nrf/working_with_nrf/nrf53/nrf5340_gs.html
+.. _Zephyr toolchain: https://developer.nordicsemi.com/nRF_Connect_SDK/doc/2.5.0/nrf/gs_installing.html#install-a-toolchain
+.. _Installing automatically: https://developer.nordicsemi.com/nRF_Connect_SDK/doc/2.5.0/nrf/gs_assistant.html#installing-automatically
+.. _Installing manually: https://developer.nordicsemi.com/nRF_Connect_SDK/doc/2.5.0/nrf/gs_installing.html#install-the-required-tools
+.. _nRF Connect SDK Getting started: https://developer.nordicsemi.com/nRF_Connect_SDK/doc/2.5.0/nrf/getting_started.html
+.. _nRF52840dk_nrf52840: https://developer.nordicsemi.com/nRF_Connect_SDK/doc/2.5.0/zephyr/boards/arm/nrf52840dk_nrf52840/doc/index.html
+.. _nrf5340dk_nrf5340: https://developer.nordicsemi.com/nRF_Connect_SDK/doc/2.5.0/zephyr/boards/arm/nrf5340dk_nrf5340/doc/index.html#nrf5340dk-nrf5340
+.. _Building and programming an application: https://developer.nordicsemi.com/nRF_Connect_SDK/doc/2.5.0/nrf/getting_started/programming.html#gs-programming
+.. _Testing and debugging an application: https://developer.nordicsemi.com/nRF_Connect_SDK/doc/2.5.0/nrf/getting_started/testing.html#gs-testing
+.. _Bootloader and DFU solutions for NCS: https://developer.nordicsemi.com/nRF_Connect_SDK/doc/2.5.0/nrf/app_bootloaders.html
+.. _Zephyr SMP Server: https://developer.nordicsemi.com/nRF_Connect_SDK/doc/2.5.0/zephyr/services/device_mgmt/ota.html#smp-server
+.. _NCS testing applications: https://developer.nordicsemi.com/nRF_Connect_SDK/doc/2.5.0/nrf/gs_testing.html
diff -urN '--exclude=.git' '--exclude=build' '--exclude=test_lr1110' '--exclude=gnss_field_test' '--exclude=lr11xx_private' '--exclude=sx126x' '--exclude=lcd1602_template_subghz' '--exclude=wakeup_test' '--exclude=.github' '--exclude=check_swdr001' sidewalk/doc/setting_up_sidewalk_environment/requirements.rst gitlab_sidewalk/doc/setting_up_sidewalk_environment/requirements.rst
--- sidewalk/doc/setting_up_sidewalk_environment/requirements.rst 2023-11-09 11:04:08.268734741 -0800
+++ gitlab_sidewalk/doc/setting_up_sidewalk_environment/requirements.rst 2023-11-01 08:09:54.855151527 -0700
@@ -51,64 +51,61 @@
RAM and flash memory requirement values differ depending on the DK and programmed sample.
+All values are provided in kilobytes (KB).
+
.. tabs::
.. tab:: nRF52840 DK
The following table lists memory requirements for samples running on the `nRF52840 DK`_.
- All values are provided in kilobytes (KB).
-
+-------------------------------------------------------------------+---------------+-------------------+---------------------+-------------+-------------+
| Sample | MCUboot ROM | Application ROM | Sidewalk Settings | Total ROM | Total RAM |
+===================================================================+===============+===================+=====================+=============+=============+
- | :ref:`Sensor monitoring <sensor_monitoring>` (Bluetooth LE Debug) | 0 | 382 | 32 | 414 | 78 |
+ | :ref:`Sensor monitoring <sensor_monitoring>` (Bluetooth LE Debug) | 0 | 371 | 32 | 403 | 78 |
+-------------------------------------------------------------------+---------------+-------------------+---------------------+-------------+-------------+
- | :ref:`Sensor monitoring <sensor_monitoring>` (FSK Debug) | 0 | 520 | 32 | 552 | 99 |
+ | :ref:`Sensor monitoring <sensor_monitoring>` (FSK Debug) | 0 | 530 | 32 | 562 | 99 |
+-------------------------------------------------------------------+---------------+-------------------+---------------------+-------------+-------------+
- | :ref:`Sensor monitoring <sensor_monitoring>` (LoRa Debug) | 0 | 480 | 32 | 512 | 98 |
+ | :ref:`Sensor monitoring <sensor_monitoring>` (LoRa Debug) | 0 | 470 | 32 | 502 | 98 |
+-------------------------------------------------------------------+---------------+-------------------+---------------------+-------------+-------------+
- | :ref:`Template sub-GHz <template_subghz>` (FSK Debug) | 36 | 532 | 28 | 596 | 109 |
+ | :ref:`Template sub-GHz <template_subghz>` (FSK Debug) | 36 | 547 | 28 | 611 | 109 |
+-------------------------------------------------------------------+---------------+-------------------+---------------------+-------------+-------------+
- | :ref:`Template sub-GHz <template_subghz>` (FSK Release) | 36 | 468 | 28 | 532 | 105 |
+ | :ref:`Template sub-GHz <template_subghz>` (FSK Release) | 36 | 479 | 28 | 543 | 105 |
+-------------------------------------------------------------------+---------------+-------------------+---------------------+-------------+-------------+
- | :ref:`Template sub-GHz <template_subghz>` (LoRa Debug) | 36 | 494 | 28 | 558 | 108 |
+ | :ref:`Template sub-GHz <template_subghz>` (LoRa Debug) | 36 | 488 | 28 | 552 | 108 |
+-------------------------------------------------------------------+---------------+-------------------+---------------------+-------------+-------------+
- | :ref:`Template sub-GHz <template_subghz>` (LoRa Release) | 36 | 422 | 28 | 486 | 104 |
+ | :ref:`Template sub-GHz <template_subghz>` (LoRa Release) | 36 | 413 | 28 | 477 | 104 |
+-------------------------------------------------------------------+---------------+-------------------+---------------------+-------------+-------------+
- | :ref:`Template Bluetooth LE <template_ble>` (Debug) | 36 | 395 | 28 | 459 | 90 |
+ | :ref:`Template Bluetooth LE <template_ble>` (Debug) | 36 | 384 | 28 | 448 | 90 |
+-------------------------------------------------------------------+---------------+-------------------+---------------------+-------------+-------------+
- | :ref:`Template Bluetooth LE <template_ble>` (Release) | 36 | 329 | 28 | 393 | 86 |
+ | :ref:`Template Bluetooth LE <template_ble>` (Release) | 36 | 314 | 28 | 378 | 86 |
+-------------------------------------------------------------------+---------------+-------------------+---------------------+-------------+-------------+
.. tab:: nRF5340 DK
The following table lists memory requirements for samples running on the `nRF5340 DK`_.
- All values are provided in kilobytes (KB).
-
+-------------------------------------------------------------------+---------------+-------------------+---------------------+-------------+-------------+
| Sample | MCUboot ROM | Application ROM | Sidewalk Settings | Total ROM | Total RAM |
+===================================================================+===============+===================+=====================+=============+=============+
- | :ref:`Sensor monitoring <sensor_monitoring>` (Bluetooth LE Debug) | 0 | 325 | 32 | 357 | 68 |
+ | :ref:`Sensor monitoring <sensor_monitoring>` (Bluetooth LE Debug) | 0 | 314 | 32 | 346 | 68 |
+-------------------------------------------------------------------+---------------+-------------------+---------------------+-------------+-------------+
- | :ref:`Sensor monitoring <sensor_monitoring>` (FSK Debug) | 0 | 457 | 32 | 489 | 89 |
+ | :ref:`Sensor monitoring <sensor_monitoring>` (FSK Debug) | 0 | 463 | 32 | 495 | 89 |
+-------------------------------------------------------------------+---------------+-------------------+---------------------+-------------+-------------+
- | :ref:`Sensor monitoring <sensor_monitoring>` (LoRa Debug) | 0 | 420 | 32 | 452 | 88 |
+ | :ref:`Sensor monitoring <sensor_monitoring>` (LoRa Debug) | 0 | 411 | 32 | 443 | 88 |
+-------------------------------------------------------------------+---------------+-------------------+---------------------+-------------+-------------+
- | :ref:`Template sub-GHz <template_subghz>` (FSK Debug) | 56 | 469 | 28 | 553 | 99 |
+ | :ref:`Template sub-GHz <template_subghz>` (FSK Debug) | 40 | 479 | 28 | 547 | 99 |
+-------------------------------------------------------------------+---------------+-------------------+---------------------+-------------+-------------+
- | :ref:`Template sub-GHz <template_subghz>` (FSK Release) | 56 | 404 | 28 | 488 | 95 |
+ | :ref:`Template sub-GHz <template_subghz>` (FSK Release) | 40 | 410 | 28 | 478 | 95 |
+-------------------------------------------------------------------+---------------+-------------------+---------------------+-------------+-------------+
- | :ref:`Template sub-GHz <template_subghz>` (LoRa Debug) | 56 | 434 | 28 | 518 | 98 |
+ | :ref:`Template sub-GHz <template_subghz>` (LoRa Debug) | 40 | 428 | 28 | 496 | 98 |
+-------------------------------------------------------------------+---------------+-------------------+---------------------+-------------+-------------+
- | :ref:`Template sub-GHz <template_subghz>` (LoRa Release) | 56 | 361 | 28 | 445 | 94 |
+ | :ref:`Template sub-GHz <template_subghz>` (LoRa Release) | 40 | 352 | 28 | 420 | 94 |
+-------------------------------------------------------------------+---------------+-------------------+---------------------+-------------+-------------+
- | :ref:`Template Bluetooth LE <template_ble>` (Debug) | 56 | 339 | 28 | 423 | 81 |
+ | :ref:`Template Bluetooth LE <template_ble>` (Debug) | 40 | 333 | 28 | 401 | 81 |
+-------------------------------------------------------------------+---------------+-------------------+---------------------+-------------+-------------+
- | :ref:`Template Bluetooth LE <template_ble>` (Release) | 56 | 270 | 28 | 354 | 77 |
+ | :ref:`Template Bluetooth LE <template_ble>` (Release) | 40 | 260 | 28 | 328 | 77 |
+-------------------------------------------------------------------+---------------+-------------------+---------------------+-------------+-------------+
-
.. include:: ../ncs_links.rst
.. _Amazon developer account: https://developer.amazon.com/dashboard
diff -urN '--exclude=.git' '--exclude=build' '--exclude=test_lr1110' '--exclude=gnss_field_test' '--exclude=lr11xx_private' '--exclude=sx126x' '--exclude=lcd1602_template_subghz' '--exclude=wakeup_test' '--exclude=.github' '--exclude=check_swdr001' sidewalk/.gitignore gitlab_sidewalk/.gitignore
--- sidewalk/.gitignore 2023-11-09 11:04:08.240734203 -0800
+++ gitlab_sidewalk/.gitignore 2023-11-01 08:09:54.839151220 -0700
@@ -45,3 +45,4 @@
YAMLLint.txt
Gitlint.txt
compliance.xml
+almanac.h
diff -urN '--exclude=.git' '--exclude=build' '--exclude=test_lr1110' '--exclude=gnss_field_test' '--exclude=lr11xx_private' '--exclude=sx126x' '--exclude=lcd1602_template_subghz' '--exclude=wakeup_test' '--exclude=.github' '--exclude=check_swdr001' sidewalk/internal_west.yml gitlab_sidewalk/internal_west.yml
--- sidewalk/internal_west.yml 2023-11-09 11:04:08.268734741 -0800
+++ gitlab_sidewalk/internal_west.yml 2023-11-01 08:09:54.855151527 -0700
@@ -13,7 +13,7 @@
- name: nrf
repo-path: sdk-nrf
path: nrf
- revision: b6848c79ae19a4e6f114939dd02561316704743e
+ revision: 1fae141fc6713dd331b797fc96c90dc84552242d
import: true
# West-related configuration for the sidewalk repository.
diff -urN '--exclude=.git' '--exclude=build' '--exclude=test_lr1110' '--exclude=gnss_field_test' '--exclude=lr11xx_private' '--exclude=sx126x' '--exclude=lcd1602_template_subghz' '--exclude=wakeup_test' '--exclude=.github' '--exclude=check_swdr001' sidewalk/Kconfig gitlab_sidewalk/Kconfig
--- sidewalk/Kconfig 2023-11-09 11:04:08.240734203 -0800
+++ gitlab_sidewalk/Kconfig 2023-11-01 08:09:54.839151220 -0700
@@ -61,6 +61,11 @@
bool "Enable sidewalk CLI"
imply SHELL
+# CLI
+config LR1110_CLI
+ bool "Enable LR1110 CLI"
+ imply SHELL
+
# Log
config SIDEWALK_LOG_MSG_LENGTH_MAX
int "Log message max length"
diff -urN '--exclude=.git' '--exclude=build' '--exclude=test_lr1110' '--exclude=gnss_field_test' '--exclude=lr11xx_private' '--exclude=sx126x' '--exclude=lcd1602_template_subghz' '--exclude=wakeup_test' '--exclude=.github' '--exclude=check_swdr001' sidewalk/lib/lora_fsk/CMakeLists.txt gitlab_sidewalk/lib/lora_fsk/CMakeLists.txt
--- sidewalk/lib/lora_fsk/CMakeLists.txt 2023-11-09 11:04:08.272734817 -0800
+++ gitlab_sidewalk/lib/lora_fsk/CMakeLists.txt 2023-11-09 10:32:25.980380696 -0800
@@ -13,4 +13,39 @@
${LIB_GCC}
)
-zephyr_link_libraries_ifndef(CONFIG_SIDEWALK_PAL_RADIO_SOURCE ${SID_LIB_DIR}/libsid_pal_radio_sx126x_impl.a)
+if(DEFINED RADIO)
+ if(${RADIO} STREQUAL "LR1110_SRC" OR ${RADIO} STREQUAL "LR1121_SRC")
+ add_subdirectory(lr11xx_private)
+ zephyr_compile_definitions(LR11xx_SRC)
+ elseif(${RADIO} STREQUAL "SX126x_SRC")
+ add_subdirectory(sx126x)
+ elseif(${RADIO} STREQUAL "LR11xx" OR ${RADIO} STREQUAL "LR1110" OR ${RADIO} STREQUAL "LR1121" )
+ set(SMTC_LIB_NAME libsmtc_lr11xx_swdr001_impl.a)
+ zephyr_include_directories(lr11xx/include)
+ if(DEFINED CONFIG_LOG)
+ if(DEFINED CONFIG_LOG_RUNTIME_FILTERING)
+ set(RADIO_LIB_NAME libsid_pal_radio_lr11xx_impl_lrf.a)
+ else()
+ set(RADIO_LIB_NAME libsid_pal_radio_lr11xx_impl.a)
+ endif()
+ else()
+ set(RADIO_LIB_NAME libsid_pal_radio_lr11xx_impl_nolog.a)
+ endif()
+ zephyr_link_libraries_ifndef(CONFIG_SIDEWALK_PAL_RADIO_SOURCE
+ ${SID_LIB_DIR}/${SMTC_LIB_NAME}
+ ${SID_LIB_DIR}/${RADIO_LIB_NAME}
+ ${SID_LIB_DIR}/${SMTC_LIB_NAME}
+ )
+ if(${RADIO} STREQUAL "LR1110")
+ zephyr_compile_definitions(LR1110 LR11xx)
+ elseif(${RADIO} STREQUAL "LR1121")
+ zephyr_compile_definitions(LR1121 LR11xx)
+ endif()
+ else()
+ message(SEND_ERROR "RADIO isnt LR1110 or LR11210 or SX126x --> ${RADIO}")
+ endif()
+else()
+ zephyr_link_libraries_ifndef(CONFIG_SIDEWALK_PAL_RADIO_SOURCE ${SID_LIB_DIR}/libsid_pal_radio_sx126x_impl.a)
+endif()
+
+
Binary files sidewalk/lib/lora_fsk/.CMakeLists.txt.swp and gitlab_sidewalk/lib/lora_fsk/.CMakeLists.txt.swp differ
Binary files sidewalk/lib/lora_fsk/libsid_pal_radio_lr11xx_impl.a and gitlab_sidewalk/lib/lora_fsk/libsid_pal_radio_lr11xx_impl.a differ
Binary files sidewalk/lib/lora_fsk/libsid_pal_radio_lr11xx_impl_lrf.a and gitlab_sidewalk/lib/lora_fsk/libsid_pal_radio_lr11xx_impl_lrf.a differ
Binary files sidewalk/lib/lora_fsk/libsid_pal_radio_lr11xx_impl_nolog.a and gitlab_sidewalk/lib/lora_fsk/libsid_pal_radio_lr11xx_impl_nolog.a differ
Binary files sidewalk/lib/lora_fsk/libsmtc_lr11xx_swdr001_impl.a and gitlab_sidewalk/lib/lora_fsk/libsmtc_lr11xx_swdr001_impl.a differ
diff -urN '--exclude=.git' '--exclude=build' '--exclude=test_lr1110' '--exclude=gnss_field_test' '--exclude=lr11xx_private' '--exclude=sx126x' '--exclude=lcd1602_template_subghz' '--exclude=wakeup_test' '--exclude=.github' '--exclude=check_swdr001' sidewalk/lib/lora_fsk/lr11xx/include/halo_lr11xx_radio.h gitlab_sidewalk/lib/lora_fsk/lr11xx/include/halo_lr11xx_radio.h
--- sidewalk/lib/lora_fsk/lr11xx/include/halo_lr11xx_radio.h 1969-12-31 16:00:00.000000000 -0800
+++ gitlab_sidewalk/lib/lora_fsk/lr11xx/include/halo_lr11xx_radio.h 2023-11-01 08:09:54.863151680 -0700
@@ -0,0 +1,39 @@
+/*
+ * Copyright (c) 2019-2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
+ *
+ * This file has private functions needed by the driver
+ */
+
+#ifndef HALO_LR1110_RADIO_H
+#define HALO_LR1110_RADIO_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include <lr11xx_config.h>
+#include "lr11xx_system.h"
+
+typedef struct
+{
+ lr11xx_wifi_channel_mask_t channel_mask;
+ uint8_t max_result;
+} wifi_configuration_scan_base_t;
+
+typedef struct
+{
+ wifi_configuration_scan_base_t base;
+ lr11xx_wifi_signal_type_scan_t signal_type;
+ lr11xx_wifi_mode_t scan_mode;
+ uint8_t nb_scan_per_channel;
+ uint16_t timeout_per_scan;
+ bool abort_on_timeout;
+} wifi_configuration_scan_t;
+
+void* lr11xx_get_drv_ctx(void);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* HALO_LR1110_RADIO_H */
diff -urN '--exclude=.git' '--exclude=build' '--exclude=test_lr1110' '--exclude=gnss_field_test' '--exclude=lr11xx_private' '--exclude=sx126x' '--exclude=lcd1602_template_subghz' '--exclude=wakeup_test' '--exclude=.github' '--exclude=check_swdr001' sidewalk/lib/lora_fsk/lr11xx/include/lr11xx_config.h gitlab_sidewalk/lib/lora_fsk/lr11xx/include/lr11xx_config.h
--- sidewalk/lib/lora_fsk/lr11xx/include/lr11xx_config.h 1969-12-31 16:00:00.000000000 -0800
+++ gitlab_sidewalk/lib/lora_fsk/lr11xx/include/lr11xx_config.h 2023-11-01 08:09:54.863151680 -0700
@@ -0,0 +1,202 @@
+/*
+ * Copyright (c) 2019-2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
+ *
+ * This file is exposed to each procuct configuration to customize the driver behavior
+ */
+
+#ifndef LR11XX_CONFIG_H
+#define LR11XX_CONFIG_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include "lr11xx_gnss.h"
+#include "lr11xx_radio_types.h"
+#include "lr11xx_system_types.h"
+#include "lr11xx_wifi.h"
+
+#include <sid_time_types.h>
+#include <semtech_radio_ifc.h>
+#include <sid_pal_radio_ifc.h>
+#include <sid_pal_serial_bus_ifc.h>
+
+#include <stdbool.h>
+#include <stdint.h>
+#include <stddef.h>
+#include <time.h>
+
+#define HALO_GPIO_NOT_CONNECTED 128
+
+#define RADIO_REGION_NA SID_PAL_RADIO_RC_NA
+#define RADIO_REGION_EU SID_PAL_RADIO_RC_EU
+#define RADIO_REGION_NONE SID_PAL_RADIO_RC_NONE
+
+typedef struct radio_lr11xx_pa_cfg {
+ lr11xx_radio_pa_cfg_t pa_cfg;
+ lr11xx_radio_ramp_time_t ramp_time;
+ int8_t tx_power_in_dbm;
+ bool enable_ext_pa;
+} radio_lr11xx_pa_cfg_t;
+
+typedef struct radio_lr11xx_regional_param {
+ uint8_t param_region;
+ int8_t max_tx_power[SID_PAL_RADIO_DATA_RATE_MAX_NUM];
+ int8_t cca_level_adjust[SID_PAL_RADIO_DATA_RATE_MAX_NUM];
+ int16_t ant_dbi;
+} radio_lr11xx_regional_param_t;
+
+typedef struct radio_lr11xx_regional_config {
+ uint8_t radio_region;
+ uint8_t reg_param_table_size;
+ const radio_lr11xx_regional_param_t *reg_param_table;
+} radio_lr11xx_regional_config_t;
+
+typedef enum {
+ LR11XX_TCXO_CTRL_NONE = 0,
+ LR11XX_TCXO_CTRL_VDD = 1,
+ LR11XX_TCXO_CTRL_DIO3 = 2
+} lr11xx_tcxo_ctrl_t;
+
+typedef int32_t (*radio_lr11xx_get_pa_cfg_t)(int8_t tx_power, radio_lr11xx_pa_cfg_t *pa_cfg);
+
+#define GNSS_RESULT_SIZE 300
+typedef struct lr11xx_gnss_result {
+ uint8_t buffer[GNSS_RESULT_SIZE];
+ uint16_t length;
+} lr11xx_gnss_result_t;
+
+typedef struct {
+ lr11xx_system_reg_mode_t regulator_mode;
+ bool rx_boost;
+ int8_t lna_gain;
+ const radio_lr11xx_get_pa_cfg_t pa_cfg_callback;
+ const struct sid_pal_serial_bus_factory *bus_factory;
+
+ struct {
+ uint32_t power;
+ uint32_t int1;
+ uint32_t radio_busy;
+ uint32_t rf_sw_ena;
+ uint32_t tx_bypass;
+ uint32_t txrx;
+ uint32_t led_rx;
+ uint32_t led_tx;
+ uint32_t led_sniff;
+ uint32_t gnss_lna;
+ } gpios;
+
+ uint16_t wakeup_delay_us;
+
+ lr11xx_system_lfclk_cfg_t lfclock_cfg;
+ struct {
+ lr11xx_tcxo_ctrl_t ctrl;
+ lr11xx_system_tcxo_supply_voltage_t tune;
+ uint32_t timeout;
+ } tcxo_config;
+
+ lr11xx_system_rfswitch_cfg_t rfswitch;
+
+ int8_t rssi_no_signal_offset;
+
+ struct {
+ void (*pre_hook)(void*arg);
+ void (*post_hook)(void*arg);
+ void *arg;
+ } wifi_scan;
+
+ struct {
+ void (*pre_hook)(void*arg);
+ void (*post_hook)(lr11xx_gnss_result_t *arg);
+ void *arg;
+ } gnss_scan;
+
+ struct sid_pal_serial_bus_client bus_selector;
+
+ struct {
+ /* It was found that during sleep IRQ line can change it's state. This options masks
+ interrupts during sleep */
+ bool irq_noise_during_sleep;
+ /* It was found that after wakeup from sleep LBD IRQ is active. This prevents further
+ normal operations. This option will enable clear of this IRQ after wakeup */
+ bool lbd_clear_on_wakeup;
+ } mitigations;
+
+ struct {
+ uint8_t *p;
+ size_t size;
+ } internal_buffer;
+
+ sid_pal_radio_state_transition_timings_t state_timings;
+ radio_lr11xx_regional_config_t regional_config;
+} radio_lr11xx_device_config_t;
+
+/**
+ * Configuration for GPS scan function
+ */
+typedef struct {
+ lr11xx_gnss_search_mode_t effort_mode;
+ uint8_t gnss_input_paramaters;
+ lr11xx_gnss_scan_mode_t mode;
+ sid_time_t timeout;
+ lr11xx_gnss_date_t date;
+} lr11xx_gnss_scan_config_t;
+
+typedef struct {
+ lr11xx_wifi_signal_type_scan_t type;
+ lr11xx_wifi_mode_t mode;
+ lr11xx_wifi_channel_mask_t mask;
+ uint32_t timeout_ms; /* Total scan time*/
+ uint8_t channel_factor; /* Nunber of scan attempts per channel */
+} lr11xx_wifi_scan_config_t;
+
+/**
+ * Callback to notify when radio is about to switch to sleep state
+ * The callback is called in software irq context. The user has to
+ * switch context from software irq in this callback.
+ */
+typedef void (*sid_pal_radio_sleep_start_notify_handler_t)(struct sid_timespec * const wakeup_time);
+
+/** @brief Set Semtech radio config parameters
+ *
+ * @param pointer to lr11xx radio device config
+ */
+void set_radio_lr11xx_device_config(const radio_lr11xx_device_config_t *cfg);
+
+/** @brief Set callback to trigger external action when radio is going to sleep.
+ *
+ * @param[in] sid_pal_radio_action_in_sleep_handler_t callback to handle
+ * entering radio sleep mode. Accepts NULL if no action is required.
+ *
+ * @retval On success RADIO_ERROR_NONE.
+ */
+int32_t sid_hal_set_sleep_start_notify_cb(sid_pal_radio_sleep_start_notify_handler_t callback);
+
+/** @brief Get tx power range the semtech chip supports
+ * This API is used by diagnostics firmware only.
+ * This is used to determine the max tx power the chip supports so that the diag
+ * firmware will not exceed the max tx power setting the chip supports
+ *
+ * @param max tx power to be populated.
+ * @param min tx power to be populated.
+ * @return On success RADIO_ERROR_NONE, on error a negative number is returned
+ */
+int32_t get_lr11xx_tx_power_range(int8_t *max_tx_power, int8_t *min_tx_power);
+
+/**
+ * @brief Start GNSS scan and get back results
+ * This API is used for diagnostic only.
+ *
+ * @param config Config for GNSS scan.
+ * @param results Results to populate.
+ * @param num Max number of results \ returned amount of results
+ * @param error Error description (if any)
+ * @return On success RADIO_ERROR_NONE, on error a negative number is returned
+ */
+int32_t lr11xx_gnss_scan(const lr11xx_gnss_scan_config_t *config, lr11xx_gnss_detected_satellite_t *results, uint8_t *num, const char **error);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* HALO_DEV_RADIO_LR11XX_INCLUDE_EXPORT_DEV_RADIO_LR11XX_CONFIG_H */
diff -urN '--exclude=.git' '--exclude=build' '--exclude=test_lr1110' '--exclude=gnss_field_test' '--exclude=lr11xx_private' '--exclude=sx126x' '--exclude=lcd1602_template_subghz' '--exclude=wakeup_test' '--exclude=.github' '--exclude=check_swdr001' sidewalk/lib/lora_fsk/lr11xx/include/semtech/lr11xx_bootloader.h gitlab_sidewalk/lib/lora_fsk/lr11xx/include/semtech/lr11xx_bootloader.h
--- sidewalk/lib/lora_fsk/lr11xx/include/semtech/lr11xx_bootloader.h 1969-12-31 16:00:00.000000000 -0800
+++ gitlab_sidewalk/lib/lora_fsk/lr11xx/include/semtech/lr11xx_bootloader.h 2023-11-01 14:13:17.504913195 -0700
@@ -0,0 +1,208 @@
+/*!
+ * @file lr11xx_bootloader.h
+ *
+ * @brief Bootloader driver definition for LR11XX
+ *
+ * The Clear BSD License
+ * Copyright Semtech Corporation 2021. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted (subject to the limitations in the disclaimer
+ * below) provided that the following conditions are met:
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * * Neither the name of the Semtech corporation nor the
+ * names of its contributors may be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED BY
+ * THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
+ * CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT
+ * NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+ * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SEMTECH CORPORATION BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef LR11XX_BOOTLOADER_H
+#define LR11XX_BOOTLOADER_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*
+ * -----------------------------------------------------------------------------
+ * --- DEPENDENCIES ------------------------------------------------------------
+ */
+
+#include "lr11xx_bootloader_types.h"
+#include "lr11xx_types.h"
+
+/*
+ * -----------------------------------------------------------------------------
+ * --- PUBLIC MACROS -----------------------------------------------------------
+ */
+
+/*
+ * -----------------------------------------------------------------------------
+ * --- PUBLIC CONSTANTS --------------------------------------------------------
+ */
+
+/*
+ * -----------------------------------------------------------------------------
+ * --- PUBLIC TYPES ------------------------------------------------------------
+ */
+
+typedef uint32_t lr11xx_bootloader_irq_mask_t;
+
+/*
+ * -----------------------------------------------------------------------------
+ * --- PUBLIC FUNCTIONS PROTOTYPES ---------------------------------------------
+ */
+
+/*!
+ * @brief Return the status registers and interrupt flags
+ *
+ * @remark To simplify system integration, this function does not actually execute the GetStatus command, which would
+ * require bidirectional SPI communication. It obtains the stat1, stat2, and irq_status values by performing an ordinary
+ * SPI read (which is required to send null/NOP bytes on the MOSI line). This is possible since the LR11XX returns these
+ * values automatically whenever a read that does not directly follow a response-carrying command is performed. Unlike
+ * with the GetStatus command, however, the reset status information is NOT cleared by this command. The function @ref
+ * lr11xx_bootloader_clear_reset_status_info may be used for this purpose when necessary.
+ *
+ * @param [in] context Chip implementation context
+ * @param [out] stat1 Content of status register 1
+ * @param [out] stat2 Content of status register 2
+ * @param [out] irq_status Interrupt flags
+ *
+ * @returns Operation status
+ */
+lr11xx_status_t lr11xx_bootloader_get_status( const void* context, lr11xx_bootloader_stat1_t* stat1,
+ lr11xx_bootloader_stat2_t* stat2,
+ lr11xx_bootloader_irq_mask_t* irq_status );
+
+/*!
+ * @brief Clear the reset status information stored in stat2
+ *
+ * @param [in] context Chip implementation context
+ *
+ * @returns Operation status
+ */
+lr11xx_status_t lr11xx_bootloader_clear_reset_status_info( const void* context );
+
+/*!
+ * @brief Return the version of the system (hardware and software)
+ *
+ * @param [in] context Chip implementation context
+ * @param [out] version Pointer to the structure holding the system version
+ *
+ * @returns Operation status
+ */
+lr11xx_status_t lr11xx_bootloader_get_version( const void* context, lr11xx_bootloader_version_t* version );
+
+/*!
+ * @brief Erase the whole flash memory of the chip
+ *
+ * This function shall be called before any attempt to write a new firmware in flash memory
+ *
+ * @param [in] context Chip implementation context
+ *
+ * @returns Operation status
+ */
+lr11xx_status_t lr11xx_bootloader_erase_flash( const void* context );
+
+/*!
+ * @brief Write encrypted data in program flash memory of the chip
+ *
+ * This function shall be used when updating the encrypted flash content of the LR11XX.
+ * The encrypted flash payload to transfer shall be represented as an array of words (i.e. 4-byte values).
+ *
+ * @param [in] context Chip implementation context
+ * @param [in] offset The offset from start register of flash
+ * @param [in] buffer Buffer holding the encrypted content. Its size in words must be at least length
+ * @param [in] length Number of words (i.e. 4 bytes) in the buffer to transfer
+ *
+ * @returns Operation status
+ */
+lr11xx_status_t lr11xx_bootloader_write_flash_encrypted( const void* context, const uint32_t offset,
+ const uint32_t* buffer, const uint8_t length );
+
+/*!
+ * @brief Write encrypted data in program flash memory of the chip
+ *
+ * This function shall be used when updating the encrypted flash content of the LR11XX.
+ * The encrypted flash payload to transfer shall be represented as an array of words (ie 4-byte values).
+ *
+ * @param [in] context Chip implementation context
+ * @param [in] offset The offset from start register of flash
+ * @param [in] buffer Buffer holding the encrypted content. Its size in words must be at least length
+ * @param [in] length Number of words (i.e. 4 bytes) in the buffer to transfer
+ *
+ * @returns Operation status
+ */
+lr11xx_status_t lr11xx_bootloader_write_flash_encrypted_full( const void* context, const uint32_t offset,
+ const uint32_t* buffer, const uint32_t length );
+
+/*!
+ * @brief Software reset of the chip.
+ *
+ * This method should be used to reboot the chip in a specified mode.
+ * Rebooting in flash mode presumes that the content in flash memory is not corrupted (i.e. the integrity check
+ * performed by the bootloader before executing the first instruction in flash is OK).
+ *
+ * @param [in] context Chip implementation context
+ * @param [in] stay_in_bootloader Selector to stay in bootloader or execute flash code after reboot. If true, the
+ * bootloader will not execute the flash code but activate SPI interface to allow firmware upgrade
+ *
+ * @returns Operation status
+ */
+lr11xx_status_t lr11xx_bootloader_reboot( const void* context, const bool stay_in_bootloader );
+
+/*!
+ * @brief Returns the 4-byte PIN which can be used to claim a device on cloud services.
+ *
+ * @param [in] context Chip implementation context
+ * @param [out] pin Pointer to the array to be populated with the PIN
+ *
+ * @returns Operation status
+ */
+lr11xx_status_t lr11xx_bootloader_read_pin( const void* context, lr11xx_bootloader_pin_t pin );
+
+/*!
+ * @brief Read and return the Chip EUI
+ *
+ * @param [in] context Chip implementation context
+ * @param [out] chip_eui The buffer to be filled with chip EUI of the LR11XX. It is up to the application to ensure
+ * chip_eui is long enough to hold the chip EUI
+ *
+ * @returns Operation status
+ */
+lr11xx_status_t lr11xx_bootloader_read_chip_eui( const void* context, lr11xx_bootloader_chip_eui_t chip_eui );
+
+/*!
+ * @brief Read and return the Join EUI
+ *
+ * @param [in] context Chip implementation context
+ * @param [out] join_eui The buffer to be filled with Join EUI of the LR11XX. It is up to the application to ensure
+ * join_eui is long enough to hold the join EUI
+ *
+ * @returns Operation status
+ */
+lr11xx_status_t lr11xx_bootloader_read_join_eui( const void* context, lr11xx_bootloader_join_eui_t join_eui );
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif // LR11XX_BOOTLOADER_H
+
+/* --- EOF ------------------------------------------------------------------ */
diff -urN '--exclude=.git' '--exclude=build' '--exclude=test_lr1110' '--exclude=gnss_field_test' '--exclude=lr11xx_private' '--exclude=sx126x' '--exclude=lcd1602_template_subghz' '--exclude=wakeup_test' '--exclude=.github' '--exclude=check_swdr001' sidewalk/lib/lora_fsk/lr11xx/include/semtech/lr11xx_bootloader_types.h gitlab_sidewalk/lib/lora_fsk/lr11xx/include/semtech/lr11xx_bootloader_types.h
--- sidewalk/lib/lora_fsk/lr11xx/include/semtech/lr11xx_bootloader_types.h 1969-12-31 16:00:00.000000000 -0800
+++ gitlab_sidewalk/lib/lora_fsk/lr11xx/include/semtech/lr11xx_bootloader_types.h 2023-11-01 14:16:32.933149949 -0700
@@ -0,0 +1,179 @@
+/*!
+ * @file lr11xx_bootloader_types.h
+ *
+ * @brief Bootloader driver types for LR11XX
+ *
+ * The Clear BSD License
+ * Copyright Semtech Corporation 2021. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted (subject to the limitations in the disclaimer
+ * below) provided that the following conditions are met:
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * * Neither the name of the Semtech corporation nor the
+ * names of its contributors may be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED BY
+ * THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
+ * CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT
+ * NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+ * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SEMTECH CORPORATION BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef LR11XX_BOOTLOADER_TYPES_H
+#define LR11XX_BOOTLOADER_TYPES_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*
+ * -----------------------------------------------------------------------------
+ * --- DEPENDENCIES ------------------------------------------------------------
+ */
+
+#include <stdbool.h>
+#include <stdint.h>
+
+/*
+ * -----------------------------------------------------------------------------
+ * --- PUBLIC MACROS -----------------------------------------------------------
+ */
+
+/*
+ * -----------------------------------------------------------------------------
+ * --- PUBLIC CONSTANTS --------------------------------------------------------
+ */
+
+/*!
+ * @brief Length in byte of the LR11XX version blob
+ */
+#define LR11XX_BL_VERSION_LENGTH ( 4 )
+
+/*!
+ * @brief Length in bytes of a PIN
+ */
+#define LR11XX_BL_PIN_LENGTH ( 4 )
+
+/*!
+ * @brief Length in bytes of a chip EUI
+ */
+#define LR11XX_BL_CHIP_EUI_LENGTH ( 8 )
+
+/*!
+ * @brief Length in bytes of a join EUI
+ */
+#define LR11XX_BL_JOIN_EUI_LENGTH ( 8 )
+
+/*
+ * -----------------------------------------------------------------------------
+ * --- PUBLIC TYPES ------------------------------------------------------------
+ */
+
+/*!
+ * @brief Fixed-length array to store a PIN
+ */
+typedef uint8_t lr11xx_bootloader_pin_t[LR11XX_BL_PIN_LENGTH];
+
+/*!
+ * @brief Fixed-length array to store a chipEUI
+ */
+typedef uint8_t lr11xx_bootloader_chip_eui_t[LR11XX_BL_CHIP_EUI_LENGTH];
+
+/*!
+ * @brief Fixed-length array to store a joinEUI
+ */
+typedef uint8_t lr11xx_bootloader_join_eui_t[LR11XX_BL_JOIN_EUI_LENGTH];
+
+/*!
+ * @brief Chip modes
+ */
+typedef enum lr11xx_bootloader_chip_modes_e
+{
+ LR11XX_BOOTLOADER_CHIP_MODE_SLEEP = 0x00,
+ LR11XX_BOOTLOADER_CHIP_MODE_STBY_RC = 0x01,
+ LR11XX_BOOTLOADER_CHIP_MODE_STBY_XOSC = 0x02,
+ LR11XX_BOOTLOADER_CHIP_MODE_FS = 0x03,
+ LR11XX_BOOTLOADER_CHIP_MODE_RX = 0x04,
+ LR11XX_BOOTLOADER_CHIP_MODE_TX = 0x05,
+ LR11XX_BOOTLOADER_CHIP_MODE_LOC = 0x06,
+} lr11xx_bootloader_chip_modes_t;
+
+/*!
+ * @brief Reset status
+ */
+typedef enum lr11xx_bootloader_reset_status_e
+{
+ LR11XX_BOOTLOADER_RESET_STATUS_CLEARED = 0x00,
+ LR11XX_BOOTLOADER_RESET_STATUS_ANALOG = 0x01,
+ LR11XX_BOOTLOADER_RESET_STATUS_EXTERNAL = 0x02,
+ LR11XX_BOOTLOADER_RESET_STATUS_SYSTEM = 0x03,
+ LR11XX_BOOTLOADER_RESET_STATUS_WATCHDOG = 0x04,
+ LR11XX_BOOTLOADER_RESET_STATUS_IOCD_RESTART = 0x05,
+ LR11XX_BOOTLOADER_RESET_STATUS_RTC_RESTART = 0x06,
+} lr11xx_bootloader_reset_status_t;
+
+/*!
+ * @brief Command status
+ */
+typedef enum lr11xx_bootloader_command_status_e
+{
+ LR11XX_BOOTLOADER_CMD_STATUS_FAIL = 0x00,
+ LR11XX_BOOTLOADER_CMD_STATUS_PERR = 0x01,
+ LR11XX_BOOTLOADER_CMD_STATUS_OK = 0x02,
+ LR11XX_BOOTLOADER_CMD_STATUS_DATA = 0x03,
+} lr11xx_bootloader_command_status_t;
+
+/*!
+ * @brief Status register 1 structure definition
+ */
+typedef struct lr11xx_bootloader_stat1_s
+{
+ lr11xx_bootloader_command_status_t command_status;
+ bool is_interrupt_active;
+} lr11xx_bootloader_stat1_t;
+
+/*!
+ * @brief Status register 2 structure definition
+ */
+typedef struct lr11xx_bootloader_stat2_s
+{
+ lr11xx_bootloader_reset_status_t reset_status;
+ lr11xx_bootloader_chip_modes_t chip_mode;
+ bool is_running_from_flash;
+} lr11xx_bootloader_stat2_t;
+
+/*!
+ * @brief Bootloader version structure definition
+ */
+typedef struct lr11xx_bootloader_version_s
+{
+ uint8_t hw;
+ uint8_t type;
+ uint16_t fw;
+} lr11xx_bootloader_version_t;
+
+/*
+ * -----------------------------------------------------------------------------
+ * --- PUBLIC FUNCTIONS PROTOTYPES ---------------------------------------------
+ */
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif // LR11XX_BOOTLOADER_TYPES_H
+
+/* --- EOF ------------------------------------------------------------------ */
diff -urN '--exclude=.git' '--exclude=build' '--exclude=test_lr1110' '--exclude=gnss_field_test' '--exclude=lr11xx_private' '--exclude=sx126x' '--exclude=lcd1602_template_subghz' '--exclude=wakeup_test' '--exclude=.github' '--exclude=check_swdr001' sidewalk/lib/lora_fsk/lr11xx/include/semtech/lr11xx_crypto_engine.h gitlab_sidewalk/lib/lora_fsk/lr11xx/include/semtech/lr11xx_crypto_engine.h
--- sidewalk/lib/lora_fsk/lr11xx/include/semtech/lr11xx_crypto_engine.h 1969-12-31 16:00:00.000000000 -0800
+++ gitlab_sidewalk/lib/lora_fsk/lr11xx/include/semtech/lr11xx_crypto_engine.h 2023-11-01 14:07:28.025127591 -0700
@@ -0,0 +1,342 @@
+/*!
+ * @file lr11xx_crypto_engine.h
+ *
+ * @brief Cryptographic engine driver definition for LR11XX
+ *
+ * The Clear BSD License
+ * Copyright Semtech Corporation 2021. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted (subject to the limitations in the disclaimer
+ * below) provided that the following conditions are met:
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * * Neither the name of the Semtech corporation nor the
+ * names of its contributors may be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED BY
+ * THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
+ * CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT
+ * NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+ * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SEMTECH CORPORATION BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef LR11XX_CRYPTO_ENGINE_H
+#define LR11XX_CRYPTO_ENGINE_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*
+ * -----------------------------------------------------------------------------
+ * --- DEPENDENCIES ------------------------------------------------------------
+ */
+
+#include <stdbool.h>
+#include "lr11xx_crypto_engine_types.h"
+#include "lr11xx_types.h"
+
+/*
+ * -----------------------------------------------------------------------------
+ * --- PUBLIC MACROS -----------------------------------------------------------
+ */
+
+/*
+ * -----------------------------------------------------------------------------
+ * --- PUBLIC CONSTANTS --------------------------------------------------------
+ */
+
+/*
+ * -----------------------------------------------------------------------------
+ * --- PUBLIC TYPES ------------------------------------------------------------
+ */
+
+/*
+ * -----------------------------------------------------------------------------
+ * --- PUBLIC FUNCTIONS PROTOTYPES ---------------------------------------------
+ */
+
+/*!
+ * @brief Select the crypto element to be used
+ *
+ * By default, the internal crypto engine is selected. It is not needed to call this command if one plans to use the
+ * internal crypto engine.
+ *
+ * @param [in] context Chip implementation context
+ * @param [in] element The type of crypto element to use
+ *
+ * @returns Operation status
+ */
+lr11xx_status_t lr11xx_crypto_select( const void* context, const lr11xx_crypto_element_t element );
+
+/*!
+ * @brief Set a key in the previously selected crypto element.
+ *
+ * @param [in] context Chip implementation context
+ * @param [out] status The status returned by the execution of this cryptographic function
+ * @param [in] key_id The identifier of the key to be set
+ * @param [in] key The key to be set
+ *
+ * @returns Operation status
+ *
+ * @see lr11xx_crypto_derive_key
+ */
+lr11xx_status_t lr11xx_crypto_set_key( const void* context, lr11xx_crypto_status_t* status, const uint8_t key_id,
+ const lr11xx_crypto_key_t key );
+
+/*!
+ * @brief Derive a key previously set.
+ *
+ * @param [in] context Chip implementation context
+ * @param [out] status The status returned by the execution of this cryptographic function
+ * @param [in] src_key_id The identifier of the key to be derived
+ * @param [in] dest_key_id The identifier where the derived key will be stored after call to @ref
+ * lr11xx_crypto_store_to_flash
+ * @param [in] nonce The nonce to be used to perform the derivation
+ *
+ * @returns Operation status
+ *
+ * @see lr11xx_crypto_set_key
+ */
+lr11xx_status_t lr11xx_crypto_derive_key( const void* context, lr11xx_crypto_status_t* status, const uint8_t src_key_id,
+ const uint8_t dest_key_id, const lr11xx_crypto_nonce_t nonce );
+
+/*!
+ * @brief Perform the needed operations to extract the payload from a join accept message.
+ *
+ * @param [in] context Chip implementation context
+ * @param [out] status The status returned by the execution of this cryptographic function
+ * @param [in] dec_key_id The identifier of the key used for message decryption
+ * @param [in] ver_key_id The identifier of the key used for MIC verification
+ * @param [in] lorawan_version LoRaWAN version to know the size of the header
+ * @param [in] header The header to compute (length linked to lorawan_version)
+ * @param [in] data The data to compute
+ * @param [in] length The length in bytes of the data to compute
+ * @param [out] data_out Placeholder for the decrypted data
+ *
+ * @returns Operation status
+ */
+lr11xx_status_t lr11xx_crypto_process_join_accept( const void* context, lr11xx_crypto_status_t* status,
+ const uint8_t dec_key_id, const uint8_t ver_key_id,
+ const lr11xx_crypto_lorawan_version_t lorawan_version,
+ const uint8_t* header, const uint8_t* data, const uint8_t length,
+ uint8_t* data_out );
+
+/*!
+ * @brief Compute an AES-CMAC.
+ *
+ * @param [in] context Chip implementation context
+ * @param [out] status The status returned by the execution of this cryptographic function
+ * @param [in] key_id The identifier of the keyused for the computation
+ * @param [in] data The data to compute
+ * @param [in] length The length in bytes of the data to compute