OpenCores
URL https://opencores.org/ocsvn/gecko3/gecko3/trunk

Subversion Repositories gecko3

Compare Revisions

  • This comparison shows the changes necessary to convert path
    /gecko3
    from Rev 12 to Rev 13
    Reverse comparison

Rev 12 → Rev 13

/trunk/GECKO3COM/gecko3com-fw/gecko3com_0.31.tar.gz Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream
trunk/GECKO3COM/gecko3com-fw/gecko3com_0.31.tar.gz Property changes : Added: svn:mime-type ## -0,0 +1 ## +application/octet-stream \ No newline at end of property Index: trunk/GECKO3COM/gecko3com-fw/firmware/include/spi_flash.h =================================================================== --- trunk/GECKO3COM/gecko3com-fw/firmware/include/spi_flash.h (revision 12) +++ trunk/GECKO3COM/gecko3com-fw/firmware/include/spi_flash.h (revision 13) @@ -75,6 +75,9 @@ #define FLASH_WRITE_BUFFER_SIZE 0x100 /**< Write Buffer = 256 bytes */ +#define SPIFLASH_SECTOR_LENGTH 0x10000 /**< Length of one sector in the flash, needed for erasing */ +#define SECTORS_PER_SLOT 16 /**< Number of sectors used for each configuration file slot */ + #define MANUFACTURER_STM 0x20 /**< id of ST microelectronics */ #define MEMTYPE_STM 0x20 /**< Memory type of M25PXX */ #define MEMCAPACITY_8MBIT_STM 0x14 /**< 8 MBit memory capacity */
/trunk/GECKO3COM/gecko3com-fw/firmware/include/gecko3com_spi.h
35,11 → 35,11
#ifndef INCLUDED_GECKO3COM_SPI_H
#define INCLUDED_GECKO3COM_SPI_H
 
#include "spi_flash.h"
 
#define START_ADRESS_SLOT0 0x0 /**< Start adress of the first fpga configuration file in the spi flash */
#define START_ADRESS_SLOT1 0x00100000 /**< Start adress of the second fpga configuration file in the spi flash */
#define start_adress_slot0(flash_drv) 0x00 /**< Start adress of the first fpga configuration file in the spi flash */
#define start_adress_slot1(flash_drv) flash_drv.capacity >> 1 /**< Start adress of the second fpga configuration file in the spi flash */
 
#define SPIFLASH_SECTOR_LENGTH 0x10000 /**< Length of one sector in the flash, needed for erasing */
#define SECTORS_PER_SLOT 16 /**< Number of sectors used for each configuration file slot */
 
 
#endif /* INCLUDED_GECKO3COM_SPI_H */
/trunk/GECKO3COM/gecko3com-fw/firmware/lib/ser.c
82,7 → 82,7
UART230 = 0x01; /*enable high speed baud rate generator, 115,2 kbaud*/
 
/*T2CON = 0x30; /*select timer 2 as baudrate generator*/
/*T2CON = 0x30;*/ /*select timer 2 as baudrate generator*/
/* Baudrate = 19200, oscillator frq. of my processor is 21.4772 MHz */
/*RCAP2H = 0xFF;*/
/*RCAP2L = 0xDD;*/
/trunk/GECKO3COM/gecko3com-fw/firmware/src/spi_flash.c
42,6 → 42,7
#include "debugprint.h"
#include "stdint.h"
 
 
SPI_flash xdata flash_dr;
 
 
69,7 → 70,7
// Hardware enables are active low.
 
if(count_bits8(enables) > 1) {
//print_info("en\n");
//print_error("en\n");
return;
}
else {
78,13 → 79,18
enables &= bmSPI_CS_MASK;
SPI_CS_PORT |= bmSPI_CS_MASK; //disable all chipselect signals
SPI_CS_PORT &= ~enables;
SPI_CS_OE |= enables;
//SPI_CS_OE |= enables;
SPI_CS_OE |= bmSPI_CS_MASK;
}
}
 
 
/** disables all SPI devices and sets the SPI and SPI CS signals to tri-state */
#define disable_all() {setup_enables (0); SPI_OE &= ~bmSPI_MASK;}
#define disable_all() { \
setup_enables (0); \
} /* SPI_OE &= ~bmSPI_MASK; \
SPI_CS_OE &= ~bmSPI_CS_MASK; \
} */
 
 
/** \brief Internal: Writes one byte to the SPI bus
165,7 → 171,7
bitSPI_MOSI = 0; /* idle state has CLK = 0 */
 
ptrCheck(flashPtr);
 
setup_enables(bmSPI_CS_FLASH);
write_byte_msb(RDID);
read_bytes_msb (flashID, 3);
219,6 → 225,8
}
else {
return UNSUPPORTED_TYPE;
/* debug stuff: */
//return *idPtr;
}
}
 
233,8 → 241,9
//print_info("r\n");
 
/* we do a bit dirty programming here:
* the adress of the device is only 24bit long, so we misuse the upper 8bits to send the
* read command to the spi flash. this avoids more complicated constructs. */
* the adress of the device is only 24bit long, so we misuse the upper 8bits
* to send the read command to the spi flash.
* this avoids more complicated constructs. */
*adress &= 0x00FFFFFF;
*adress |= 0x03000000; //set the upper 8bit to the READ command
 
264,8 → 273,9
disable_all();
 
/* we do a bit dirty programming here:
* the adress of the device is only 24bit long, so we misuse the upper 8bits to send the
* read command to the spi flash. this avoids more complicated constructs. */
* the adress of the device is only 24bit long, so we misuse the upper 8bits
* to send the read command to the spi flash.
* this avoids more complicated constructs. */
*adress &= 0x00FFFFFF;
*adress |= 0xD8000000; //set the upper 8bit to the SE (sector erase) command
 
327,8 → 337,9
//printf_tiny("%d\n",writeableBytes);
 
/* we do a bit dirty programming here:
* the adress of the device is only 24bit long, so we misuse the upper 8bits to send the
* read command to the spi flash. this avoids more complicated constructs. */
* the adress of the device is only 24bit long, so we misuse the upper 8bits
* to send the read command to the spi flash.
* this avoids more complicated constructs. */
*adress &= 0x00FFFFFF;
*adress |= 0x02000000; //set the upper 8bit to the PP (page programm) command
/trunk/GECKO3COM/gecko3com-fw/firmware/src/gecko3com_main.c
306,10 → 306,10
/* select which file slot we have to delete */
if(buffer[*offset] == '0') {
flash_adress = START_ADRESS_SLOT0;
flash_adress = start_adress_slot0(flash_dr);
}
else if(buffer[*offset] == '1'){
flash_adress = START_ADRESS_SLOT1;
flash_adress = start_adress_slot1(flash_dr);
}
else {
//print_err("slot\n");
405,10 → 405,10
/* select which file slot we have to delete */
slot = buffer[*offset];
if(slot == '0') {
flash_adress = START_ADRESS_SLOT0;
flash_adress = start_adress_slot0(flash_dr);
}
else if(slot == '1'){
flash_adress = START_ADRESS_SLOT1;
flash_adress = start_adress_slot1(flash_dr);
}
else {
//print_err("del\n");
575,6 → 575,7
 
buffer = EP2FIFOBUF;
scpi_scanner.action = NOACTION;
index = 0;
 
while (1){
 
947,11 → 948,11
/* read which configuration, the first or second, we should use */
if(get_switch()){
led_color = GREEN;
spi_base_adress = START_ADRESS_SLOT0;
spi_base_adress = start_adress_slot0(flash_dr);
}
else {
led_color = RED;
spi_base_adress = START_ADRESS_SLOT1;
spi_base_adress = start_adress_slot1(flash_dr);
}
/* read the configuration file size from the spi flash */
962,6 → 963,11
((idata uint8_t*)&file_size)[3] = response_queue.buf[3];
spi_base_adress += 4;
 
/* debug stuff */
response_queue.buf[0] = init_spiflash(&flash_dr);
IEEE488_set_mav();
response_queue.length = 1;
 
/* there is nothing to configure when the filesize is 0 or 0xFFFFFFFF */
if(file_size == 0 || file_size == 0xFFFFFFFF) {
/* show that we don't load a config */
/trunk/GECKO3COM/gecko3com-fw/firmware/src/gecko3com Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream
/trunk/GECKO3COM/gecko3com-fw/firmware/src/usb_tmc.c
274,8 → 274,10
usb_tmc_status = TMC_STATUS_SUCCESS;
{
uint8_t i = 0;
code char *local_capabilities = &((code char)USB_TMC_CAPABILITIES);
for(i;i<0x18;i++){
EP0BUF[i] = (&(uintptr_t)USB_TMC_CAPABILITIES)[i];
//EP0BUF[i] = (&(uintptr_t)USB_TMC_CAPABILITIES)[i];
EP0BUF[i] = local_capabilities[i];
}
EP0BCH = 0;
EP0BCL = 0x18;

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.