Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SX126x HAL #19127

Closed
wants to merge 0 commits into from
Closed

SX126x HAL #19127

wants to merge 0 commits into from

Conversation

klim4685e
Copy link

@klim4685e klim4685e commented Jan 11, 2023

Contribution description

It's a HAL implementation for Semtech SX126x driver. Basically created for RAK3172 module (STM32WLE5CC).

Testing procedure

tests/ieee802154_hal: set the SYMBOL_TIME 256 (2^SF/BW*1000000) us
Run and you should see:

  • Correct ACK replies after transmission
  • Correct address filter
  • CCA

Problems

ACK doesn't work in tests/ieee802154_submac.
I've got noack event

Issues/PRs references

TODO

MOVED TO #19172

@github-actions github-actions bot added Area: boards Area: Board ports Area: doc Area: Documentation Area: drivers Area: Device drivers Area: examples Area: Example Applications Area: Kconfig Area: Kconfig integration Area: LoRa Area: LoRa radio support Area: network Area: Networking Area: sys Area: System Area: tests Area: tests and testing framework labels Jan 11, 2023
@jdavid
Copy link
Contributor

jdavid commented Jan 13, 2023

Thanks @3JIouHoCoK

I got a kernel panic (with the lora-e5-dev board):

$ BOARD=lora-e5-dev make -C tests/ieee802154_hal all flash term
[...]
2023-01-13 10:56:55,957 # main(): This is RIOT! (Version: 2023.01-devel-109-g3ac9b-hal-sx126x)
2023-01-13 10:56:55,958 # Trying to register sx126x.
2023-01-13 10:56:55,958 # Success
2023-01-13 10:56:55,973 # 8003c21
2023-01-13 10:56:55,973 # *** RIOT kernel panic:
2023-01-13 10:56:55,974 # FAILED ASSERTION.
2023-01-13 10:56:55,974 # 
2023-01-13 10:56:55,983 # 	pid | name                 | state    Q | pri | stack  ( used) ( free) | base addr  | current     
2023-01-13 10:56:55,990 # 	  - | isr_stack            | -        - |   - |    512 (  188) (  324) | 0x20000000 | 0x200001c8
2023-01-13 10:56:56,001 # 	  1 | main                 | running  Q |   7 |   1536 (  620) (  916) | 0x20000424 | 0x20000934 
2023-01-13 10:56:56,008 # 	  2 | event                | bl anyfl _ |   6 |   1024 (  188) (  836) | 0x20000b00 | 0x20000e44 
2023-01-13 10:56:56,016 # 	    | SUM                  |            |     |   3072 (  996) ( 2076)
2023-01-13 10:56:56,016 # 
2023-01-13 10:56:56,017 # *** halted.

@jdavid
Copy link
Contributor

jdavid commented Jan 13, 2023

The assertion error is fixed with this change to the drivers/sx126x/sx126x_radio_hal.c file:

+#ifdef BOARD_RAK3172
 #define SX126X_TIMER                        TIMER_DEV(1)
+#else
+#define SX126X_TIMER                        TIMER_DEV(0)
+#endif

@klim4685e
Copy link
Author

klim4685e commented Jan 13, 2023

Hi @jdavid
It's because only 1 timer is defined in lora-e5-dev board . I add an extra one in periph_conf.h (see on /stm32/include/cfg_timer_tim2_tim1.h), because with TIMER_DEV(0) I had some problems with shell.

@jdavid
Copy link
Contributor

jdavid commented Jan 16, 2023

I don't receive anything:

> print_addr
2023-01-16 13:04:17,398 # print_addr
2023-01-16 13:04:17,399 # AA:94:4E:77:B0:CA:14:62
> print_addr
2023-01-16 13:04:21,890 # print_addr
2023-01-16 13:04:21,891 # 5E:E2:1F:F5:61:1E:BB:94
> txtsnd AA:94:4E:77:B0:CA:14:62 5 ackreq 
2023-01-16 13:04:23,349 # txtsnd AA:94:4E:77:B0:CA:14:62 5 ackreq
2023-01-16 13:04:23,355 # [sx126x] netdev: set STATE_STANDBY
2023-01-16 13:04:23,360 # [sx126x] netdev: send: wrote data to payload buffer.
2023-01-16 13:04:23,362 # [sx126x] netdev: send: wrote data to payload buffer.
2023-01-16 13:04:23,366 # [sx126x] writing (size: 26).
2023-01-16 13:04:23,367 # Filter_ack_only
2023-01-16 13:04:23,368 # [sx126x] netdev: set STATE_TX
2023-01-16 13:04:23,389 # [sx126x] netdev: SX126X_IRQ_TX_DONE
2023-01-16 13:04:23,395 # [sx126x] netdev: SX126X_IRQ_NONE
2023-01-16 13:04:23,396 # [sx126x] netdev: set STATE_RX
2023-01-16 13:04:23,396 # Transmission succeeded
  • Using 2 LoRa E5 boards (STM32WLE5JC)
  • I changed SYMBOL_TIME to 256 as stated in this PR description (tried as well with 1024)
  • Using TIMER_DEV(0) as told above (no problems with the shell here)

Any idea what could be wrong?

@klim4685e
Copy link
Author

Hi @jdavid

I have not problems with running ieee802154_hal with TIMER_DEV(0), but sending in ieee802154_submac sends "event" process to mutex. I didn't dive deeply in this problem, but just try add an extra timer :)

@klim4685e klim4685e closed this Jan 17, 2023
@github-actions github-actions bot removed Area: Kconfig Area: Kconfig integration Area: tests Area: tests and testing framework Area: examples Area: Example Applications Area: boards Area: Board ports Area: network Area: Networking Area: sys Area: System Area: drivers Area: Device drivers Area: LoRa Area: LoRa radio support Area: doc Area: Documentation labels Jan 17, 2023
@jia200x
Copy link
Member

jia200x commented Jan 18, 2023

why was this closed? :(

@klim4685e
Copy link
Author

@jia200x I wipe my repo accidentally :D Tommorow I will restore it

@jia200x
Copy link
Member

jia200x commented Jan 18, 2023

@jia200x I wipe my repo accidentally :D Tommorow I will restore it

awesome! looking forward to that

@klim4685e
Copy link
Author

Hi @jia200x @jdavid

I created a new Pull Request draft because a new branch. #19172

*I'm beginner in git, I'm still learn basics :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants