Author Topic: Weird STM32F103 USB module!! [SOLVED]  (Read 2792 times)

0 Members and 1 Guest are viewing this topic.

Offline DELTA67Topic starter

  • Regular Contributor
  • *
  • Posts: 104
  • Country: fr
Re: Weird STM32F103 USB module!!
« Reply #25 on: October 17, 2024, 09:30:18 am »
The last byte copied might, in case of an odd number of bytes received, not be zero. And when using a circular byte buffer as I do in my code there is the risk of crossing the buffer boundary.
You're totaly right and thanks to point this issue. At the moment the goal is to receive requests from host as simply as possible, there's no ciruclar buffers or such complicated things.

I've joined the experimental project PLEASE let me know if there's some thing wrong.
« Last Edit: October 17, 2024, 09:47:32 am by DELTA67 »
 

Online ataradov

  • Super Contributor
  • ***
  • Posts: 11934
  • Country: us
    • Personal site
Re: Weird STM32F103 USB module!!
« Reply #26 on: October 17, 2024, 01:47:25 pm »
I did think about using uint32_t pointers, but did not propose it, since on newer device where locations have no gaps, 32-bit access does not work and violates the requirement for accessing the buffer. Recalculating the correct address for each access seems more universal.

You need to start responding to those requests now.
Alex
 

Offline DELTA67Topic starter

  • Regular Contributor
  • *
  • Posts: 104
  • Country: fr
Re: Weird STM32F103 USB module!!
« Reply #27 on: October 17, 2024, 01:59:35 pm »
You need to start responding to those requests now.
Yah, the next step is sending the device descriptor and get the assigned address and display it.
1- It seems that proteus display only 512bytes from the 1024 the PMA have!
2- I don't know how to let wireshark capture the trafic between PROTEUS and the host.
When I launch wireshark it only detects my 2 hardware root hubs.
« Last Edit: October 17, 2024, 02:03:23 pm by DELTA67 »
 

Online ataradov

  • Super Contributor
  • ***
  • Posts: 11934
  • Country: us
    • Personal site
Re: Weird STM32F103 USB module!!
« Reply #28 on: October 17, 2024, 02:00:57 pm »
No idea how proteus works, can't help you here.
Alex
 

Offline DELTA67Topic starter

  • Regular Contributor
  • *
  • Posts: 104
  • Country: fr
Re: Weird STM32F103 USB module!!
« Reply #29 on: October 17, 2024, 02:28:04 pm »
No idea how proteus works, can't help you here.
Never mind.
 

Online pcprogrammer

  • Super Contributor
  • ***
  • Posts: 4731
  • Country: nl
Re: Weird STM32F103 USB module!!
« Reply #30 on: October 17, 2024, 05:35:43 pm »
1- It seems that proteus display only 512bytes from the 1024 the PMA have!

The F103 only has 512 bytes in the PMA. See page 625/1134 of RM0008 Rev 20. Attached is a capture of the bit showing it is only 512 bytes.

There is also a mention about this dedicated 512 byte SRAM being shared with the CAN peripheral on page 622.

Also added where it shows that both the registers and PMA are 16 bits wide but 32 bits aligned. Access can be done based on both 16 bits and 32 bits wide. As for portability it probably has to be re written to work with newer devices anyway. Have not played with USB on such devices yet, but what I wrote for the F103 does work on the F303.

2- I don't know how to let wireshark capture the trafic between PROTEUS and the host.

It PROTEUS only mimics a USB interface to be seen by the target device it won't show up under the host itself and wireshark won't be able to use it. But I don't have any knowledge about PROTEUS.


Offline DELTA67Topic starter

  • Regular Contributor
  • *
  • Posts: 104
  • Country: fr
Re: Weird STM32F103 USB module!!
« Reply #31 on: October 17, 2024, 08:00:45 pm »
The F103 only has 512 bytes in the PMA.
Yes, but those 512bytes occupy 1024 in the memory map due to the 16bits gaps!
PROTEUS 8.13 shows only the first 512 bytes from the memory map starting at 0x40006000.

 
PROTEUS only mimics a USB interface to be seen by the target device it won't show up under the host itself and wireshark won't be able to use it.
Ok, I think so.
« Last Edit: October 17, 2024, 08:11:25 pm by DELTA67 »
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf