Ethernet Library doubt of STM32

Post your requests and ideas on the future development of mikroC PRO for ARM.
Post Reply
Author
Message
RAMASUBBU
Posts: 58
Joined: 19 Nov 2016 06:26

Ethernet Library doubt of STM32

#1 Post by RAMASUBBU » 28 Jun 2017 14:34

Hi,

I am using STM32F407 controller with dp83848 chip for Ethernet communication.

How to set the destination IP through Ethernet library.which function i have to use to set the destination IP

Remaining configurations i have done through below functions

Code: Select all

 Ethernet_Intern_Init(myMacAddr, myIpAddr, _ETHERNET_AUTO_NEGOTIATION, &_GPIO_MODULE_ETHERNET);
  
       Ethernet_Intern_confNetwork(ipMask, gwIpAddr, dnsIpAddr);

I want to establish the connection between device and PC (TCP)
Thanks & Regards,
Ramasubbu.V:)

User avatar
lana.arsic
mikroElektronika team
Posts: 1715
Joined: 15 Jan 2016 12:50

Re: Ethernet Library doubt of STM32

#2 Post by lana.arsic » 30 Jun 2017 10:07

Hi Ramasubbu,

I suggest you to look in Ethernet Demo example which is located
in installation folder in the compiler, for example in:

c:\Users\Public\Documents\Mikroelektronika\mikroC PRO for ARM\Examples\ST\Development Systems\EasyMx PRO v7 for STM32 ARM\Ethernet Demo\

There you can see how to set appropriate network parameters for server.

Kind regards,
Lana

RAMASUBBU
Posts: 58
Joined: 19 Nov 2016 06:26

Re: Ethernet Library doubt of STM32

#3 Post by RAMASUBBU » 01 Jul 2017 10:31

Hi Lana,

Thanks for your response.
I have taken that code only.in this code .Ethernet_Intern_Init function returns 1(ERROR)
so what will be the problem and where i can find the description for the functions like - Ethernet_Intern_PHY_Read
Thanks & Regards,
Ramasubbu.V:)

User avatar
lana.arsic
mikroElektronika team
Posts: 1715
Joined: 15 Jan 2016 12:50

Re: Ethernet Library doubt of STM32

#4 Post by lana.arsic » 03 Jul 2017 17:43

Hi Ramasubbu,

Did you set up parameters according to your network
(IP address, gateway...)?

Which hardware are you using?

Description of all libraries can be found in Help menu in the compiler.

Kind regards,
Lana

RAMASUBBU
Posts: 58
Joined: 19 Nov 2016 06:26

Re: Ethernet Library doubt of STM32

#5 Post by RAMASUBBU » 04 Jul 2017 10:34

Hi lana,

I am having mikro -C Pro ARM version.4.9.2.i cant able to find a description of this "Ethernet_Intern_PHY_Read" function not only this function same like lot of functions ..

I have a custom board with STM32F407 and DP838348cv for Ethernet

In my code am trying to read some register of DP838348-CV through Ethernet_Intern_PHY_Read function. so i want to know the return value for success /failure

How it will get the physical address of the chip DP838348cv . How can i change the physical address through program
Thanks & Regards,
Ramasubbu.V:)

User avatar
lana.arsic
mikroElektronika team
Posts: 1715
Joined: 15 Jan 2016 12:50

Re: Ethernet Library doubt of STM32

#6 Post by lana.arsic » 05 Jul 2017 17:18

Hi Ramasubbu,

For functions used in Network Etherenet library from the Libstock,
you can find desription in Help menu which is located
in installation folder of the package, for example in:

c:\Users\Public\Documents\Mikroelektronika\mikroC PRO for ARM\Packages\Network_Ethernet_ARM\Help\

Function Ethernet_intern_PHY_Read is used by other functions from the library,
its declaration is: unsigned char Net_Ethernet_Intern_PHY_Read (unsigned char phy_reg, unsigned int *dat); where
phy_reg is address from which you wish to read and *dat is pointer to data read from the PHY register.

Unfortunately, we don't have module which uses DP838348cv,
but which value are you getting when you call Net_Ethernet_Intern_PHY_Read?

Kind regards,
Lana

RAMASUBBU
Posts: 58
Joined: 19 Nov 2016 06:26

Re: Ethernet Library doubt of STM32

#7 Post by RAMASUBBU » 06 Jul 2017 08:09

hi lana,

I am getting 65535 value through this (Net_Ethernet_Intern_PHY_Read) function also

How can i change the physical address through library . is it possible?
Thanks & Regards,
Ramasubbu.V:)

User avatar
lana.arsic
mikroElektronika team
Posts: 1715
Joined: 15 Jan 2016 12:50

Re: Ethernet Library doubt of STM32

#8 Post by lana.arsic » 07 Jul 2017 17:10

Hi Ramasubbu,

If you are getting 0xFFFF (65535) please check
if you addressing the PHY with its correct address.
RAMASUBBU wrote: How can i change the physical address through library . is it possible?
Did you mean on MAC address? If so, then you can set it with parameter const char myMacAddr[6]
and use it through Net_Ethernet_Intern_Init function.

Kind regards,
Lana

RAMASUBBU
Posts: 58
Joined: 19 Nov 2016 06:26

Re: Ethernet Library doubt of STM32

#9 Post by RAMASUBBU » 14 Jul 2017 11:47

Hi lana,

Not a MAC address . its chip address of DP83848CVV without this address we cant able to read/ write physical register of DP83848

the below routine i have written to set the chip address

Code: Select all

void Ethernet_SetPhyChipAddr(unsigned long  uladdress){

    while(Ethernet_MAC_MACMIIAR.MB) {
     UART3_Write_Text(" -> BUSY ");
    }
    
  
    // to set the physical address
    
    Ethernet_MAC_MACMIIAR &= ~( 0x0000f800) ;         // 0000 0000 0000 0000 1111 1000 0000 0000
    
    Ethernet_MAC_MACMIIAR |= (uladdress << 11 ) & 0x0000f800 ; // bit 11 to 15 of chip address

}
how to set this address through library. what is the default address loaded from the library
Thanks & Regards,
Ramasubbu.V:)

User avatar
lana.arsic
mikroElektronika team
Posts: 1715
Joined: 15 Jan 2016 12:50

Re: Ethernet Library doubt of STM32

#10 Post by lana.arsic » 17 Jul 2017 16:05

Hi Ramasubbu,

Our library is made to work with modules which we have on our hardware,
according to datasheet of DP83848CVV, it uses UART and our library uses SPI,
therefore it cannot work with it.

You can try to write your own library, using DP83848CVV datasheet

Kind regards,
Lana

RAMASUBBU
Posts: 58
Joined: 19 Nov 2016 06:26

Re: Ethernet Library doubt of STM32

#11 Post by RAMASUBBU » 24 Jul 2017 07:43

Hi Lana,

Thank for your responses.
now its working fine ...
Thanks & Regards,
Ramasubbu.V:)

n_vikranth
Posts: 35
Joined: 11 Jan 2012 15:06

Re: Ethernet Library doubt of STM32

#12 Post by n_vikranth » 18 Jul 2019 08:00

Hi Ramasubbu,
Iam planned to use STM32F207VG with DP83848 using internal library, can you share you code for my reference.

Post Reply

Return to “mikroC PRO for ARM Wish List”