USB-HOST Driver Design Based on UClinux2.4.x+S3C4510B Development Platform

Today, USB devices have entered all aspects of our work and life. It has brought us a lot of convenience. Therefore, with USB capabilities has become a basic requirement of many systems today. The S3C4510B developed by Samsung for the arm7 is a very frequently used chip in the industry. Its powerful features make it the terminator based on many traditional 51 series microcontroller development ideas. By porting uClinux operating system to it, it is like adding a tiger. The stable Linux system is tightly integrated with the powerful S3C4510B hardware, forming a powerful development platform, bringing with it a new development concept. This article uses the EMBEST S3C4510B development board developed by Shenzhen Yingkeite Company and describes the expansion of the USB-HOST based on the SL811HS (HOST) developed by CYPRESS on such a powerful platform; it shows the difference between this system and traditional system development. New ideas, while further enriching the system's functionality.

1 expansion board hardware circuit design

When Intech's development board based on uClinux2.4.x+S3C4510B is implemented, the program is placed in the ROM/ARAM/FLASH group 0 controlled by the ROMCON0 base address; when the system is started up, the program placed in this group is copied to the SDRAM 0 group. This article will be SL811HS address assigned to the ROM / ARAM / Flash group 1, the ROMCON1 control its base address, the use of external interrupt 0 to receive the SL811HS interrupt signal. Since the SL811HS does not separate the data from the address bus, D0 to D7 will be time-multiplexed. This is controlled by the A0 line of the SL811HS. When A0 is low, the address information is transmitted on D0 to D7. When A0 is high, data is transmitted on D0 to D7. As a result, A0 is controlled by ADDR10 of S3C4510B to separate the SL811HS data from the internal address.

2 kernel modifications

To configure SL811HS to Bank1 controlled by ROMCON1, the main application is to make changes to the following two files.

1...armnommusnds100.h

Line 216

#define DSR1 (0<<2)

Change to:

#define DSR1 (1<<2)

This will define Bank1 as an 8-bit byte.

Line 249

#define rROMCON1 0x0

Change to:

#define ROM_BASE1_R ((0x00200000>>16)<<10)

#define ROM_NEXT1_R (0x00300000>>16)<<20)

#definerROMCON1_R(ROM_NEXT1_R|ROM_BASE1_R|tACC0|tPA0|PMC0)

#define rROMCON0_B

(ROM_NEXT1_B|ROM_BASE1_tACC0|tPA0|PMC0)

ROM_x_R here refers to the value after the system reset, but also the value of the system at startup. The ROM_x_B refers to the system in the boot, you want to copy the program to run in SDRAM, so the original FLASH-BANK0 can no longer use the 0 address, but should be used by the SDRAM0 0 address. This ROM_x_B is the new address of the corresponding flash group when the program is running in SDRAM.

2....s

Will be line 162

Ldr r1,=0x200000

Change to ldr r1,=0x300000

This tells the system how much space to copy from Flash storage to SDRAM.

Will line 259

.word rROMCON1

Changed to .word rROMCON1_R

Will be line 272

.word rROMCON1

Change to .word rROMCON1_B

In this way, the configuration values ​​of rROMCON1 in two different modes of reset and boot are saved with different registers. However, when the program is running, it is not determined by this value, but is determined by rROMCON1. ​​Therefore, the program must assign one of the two modes to rROMCON1 at the appropriate time for the system to use.

3 Hardware circuit detection

After the above two steps, the SL811HS is configured to the ROM/ARAM/Flash group 1 controlled by rROMCON1. ​​The data port address is 0x1200400 and the address port address is 0x1200000. Interrupt is external interrupt 0. The following small program can be used to test whether the SL811HS internal register can be read and written correctly.

/***filename:test811.c****/

Int main(void){

Unsigned char *addr,*data,I,j,x,val;

Int k,m;

Addr=0x1200000;

Data=0x1200400;

For(i=0x10;i<0x100;i++)

{mywriteb(i,addr);

Mywriteb(i,data);}

Printf("test now!");

For(i=0x10;i<0x100;i++)

{mywriteb(i,addr);

Val=myreadb(data);

If(val!=i)

Printf("error in test address %d",i);}

}

Char myreadb(int addr)

{ unsigned char *addr1;

Unsigned char data;

Addr1=addr;

Data=*addr1;

Return(data);}

Void mywrited(unsigned char data, int addr)

{ unsigned char*addr1;

Addr1=addr;

*addr=data;}

Use this program as an application and compile it with the kernel as a whole. Specific methods can refer to the document /documentation/adding-user-apps-howto.txt;

After the kernel is compiled and downloaded, it is downloaded to the development board, and then the system is started. The host computer uses the HyperTerminal to monitor. After the system starts up, run the application. If there is no error, the hardware connection is correct.

4 Drive Porting

The USB-HOST (SL811HS) driver does not need to be written separately. The Linux kernel has ready-made code for reference, and can also be downloaded from the CYPRESS website. However, this driver is designed for sal100, so it must be changed to use on our S3C4510B system.

The changes here are mainly modifications to the file hc_s1811.c. The file is located at .../driver/usb/

The hardware address must be modified first because the data and address port addresses of the SL811HS are 0x1200400 and 0x1200000, respectively. Modify the line 106, 107

Static int base_addr=0xd3800000;

Static int data_reg_addr=0xd3810000;

Static int base_addr=0x1200000;

Static int data_reg_addr=0x1200400;

Modify the line 130, 131

#define SL811HC_IOPORT0 0xa000000

#define SL811HC_IOPORT0 0x1200000

#define SL811HC_IODATAPORT0 0x120040

Since the interrupt of SL811HS is allocated as interrupt 0, line 108 should be modified

Static int irq=34;

Static int irq=0;

Modified line 139

#define Sl811HC_IRQ0 27

#define SL811HC_IRQ0 0

And need to rewrite the function void init_irq(void)

Void init_irq(void)

{

INT_ENABLE(irq);

IntPend=0x1FFFFF;

IntMode=INT_MODE_IRQ;

}

Then start the kernel compilation. In the kernel configuration, select the SL811HS item, burn the compiled kernel to the board, and start it. With the super terminal monitoring of the upper computer, it can be seen that the system has allocated resources such as address and interrupt for the SL811HS. At this point, the USB-HOST extension is complete.

Conclusion

The widespread use of USB devices has allowed many systems to consider extending it to meet the needs of our customers. This article describes the detailed steps for extending the SL811HS (host) on the EMBEST3SC4510B development board of Indigo, and gives a self-made test program, which provides a simple and powerful tool for hardware detection and further development of the USB port. Device drivers provide the hardware platform.

ZGAR AZ MC Vape

ZGAR AZ MC Disposable


ZGAR electronic cigarette uses high-tech R&D, food grade disposable pod device and high-quality raw material. All package designs are Original IP. Our designer team is from Hong Kong. We have very high requirements for product quality, flavors taste and packaging design. The E-liquid is imported, materials are food grade, and assembly plant is medical-grade dust-free workshops.


Our products include disposable e-cigarettes, rechargeable e-cigarettes, rechargreable disposable vape pen, and various of flavors of cigarette cartridges. From 600puffs to 5000puffs, ZGAR bar Disposable offer high-tech R&D, E-cigarette improves battery capacity, We offer various of flavors and support customization. And printing designs can be customized. We have our own professional team and competitive quotations for any OEM or ODM works.


We supply OEM rechargeable disposable vape pen,OEM disposable electronic cigarette,ODM disposable vape pen,ODM disposable electronic cigarette,OEM/ODM vape pen e-cigarette,OEM/ODM atomizer device.



Disposable E-cigarette, ODM disposable electronic cigarette, vape pen atomizer , Device E-cig, OEM disposable electronic cigarette

ZGAR INTERNATIONAL(HK)CO., LIMITED , https://www.szvape-pods.com

This entry was posted in on